﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    
    <Color x:Key="WindowBackgroundColor">#FFEFEFEF</Color>
    <LinearGradientBrush x:Key="WindowBackgroundBrush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFEFEFEF" Offset="0"/>
        <GradientStop Color="#FFEFEFEF" Offset="1"/>
    </LinearGradientBrush>



    <!--  Basic Brushes -->
    <SolidColorBrush x:Key="TextBrush" Color="#818181" />
    <!--<Color x:Key="PrimaryColor">#f9f9e4</Color>-->
    <Color x:Key="PrimaryColor">#ffffff</Color>
    <!--<Color x:Key="SecondaryColor">#EFEFEFFF</Color>-->
    <Color x:Key="SecondaryColor">#E5E5E5E5</Color>
    <SolidColorBrush x:Key="PrimaryBrush" Color="{DynamicResource PrimaryColor}" />
    <SolidColorBrush x:Key="SecondaryBrush" Color="{DynamicResource SecondaryColor}" />
    <Color x:Key="DisabledColor">#8CFFFFFF</Color>

    <RadialGradientBrush x:Key="HaloMask">
        <RadialGradientBrush.RelativeTransform>
            <TransformGroup>
                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.25" ScaleY="4" />
                <TranslateTransform Y="-.2" />
            </TransformGroup>
        </RadialGradientBrush.RelativeTransform>
        <GradientStop Color="#00ffffff" Offset="0.528" />
        <GradientStop Color="#26FFFFFF" Offset="0.776" />
        <GradientStop Color="#BFFFFFFF" Offset="1" />
    </RadialGradientBrush>
    <LinearGradientBrush x:Key="FocusMask" EndPoint="0,.5" StartPoint="1,.5">
        <GradientStop Color="#99000000" Offset="0" />
        <GradientStop Color="#33FFFFFF" Offset=".5" />
        <GradientStop Color="#99000000" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="BottomShadowMask" EndPoint="0.5,1.75" StartPoint="0.5,-.25">
        <GradientStop Color="#00000000" Offset="0.2" />
        <GradientStop Color="#FFFFFFFF" Offset="1" />
    </LinearGradientBrush>
    <LinearGradientBrush x:Key="BoxBottomShadowMask" EndPoint="0.5,1" StartPoint="0.5,-1">
        <GradientStop Color="#FFFFFFFF" Offset="0" />
        <GradientStop Color="#EFEFEF" Offset="0.675" />
        <!--<GradientStop Color="#00000000" Offset="0.675" />-->
    </LinearGradientBrush>

    <Style TargetType="StatusBarItem">
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
    </Style>

    <!--Button-->
    <Color x:Key="BorderColor">#C0C0C0</Color>
    <SolidColorBrush x:Key="ButtonBorderBrush" Color="{DynamicResource BorderColor}" />

    <Style TargetType="Button">
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="Padding" Value="8,3" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="HasFocus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2000000" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
                                    <VisualTransition From="Pressed" GeneratedDuration="00:00:00" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="2.5,2.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0.5,0.5,1.5,1.5" />
                        <Grid x:Name="InnerShadow" Grid.RowSpan="2" Grid.ColumnSpan="2">
                            <Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}" />
                            <Border x:Name="Halo" CornerRadius="12" Background="{TemplateBinding BorderBrush}" OpacityMask="{StaticResource HaloMask}" />
                        </Grid>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
                            <ContentPresenter.RenderTransform>
                                <TransformGroup>
                                    <TranslateTransform />
                                </TransformGroup>
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                        <Border x:Name="HasFocus" CornerRadius="13" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Margin="-3" Visibility="Collapsed" OpacityMask="{StaticResource FocusMask}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderThickness" TargetName="Background" Value="0.5,0.5,0.5,0.5" />
                            <Setter Property="Opacity" TargetName="InnerShadow" Value="0.65" />
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.35" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ToggleButton-->
    <!--ToggleButton-->
    <Style TargetType="{x:Type ToggleButton}">
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value=".5,.5,1.5,1.5" />
        <Setter Property="Padding" Value="8,3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
                                    <VisualTransition From="Pressed" GeneratedDuration="00:00:00" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="2.5,2.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="1.75,1.75,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Toggled" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="HasFocus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="HasFocus" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="HasFocus" CornerRadius="13" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Margin="-3" Visibility="Visible" OpacityMask="{DynamicResource FocusMask}" Background="#00000000" Opacity="0" />
                        <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0.5,0.5,1.5,1.5">
                            <Border x:Name="Toggled" CornerRadius="11" Background="{TemplateBinding BorderBrush}" Opacity=".2" Visibility="Collapsed" />
                        </Border>
                        <Grid x:Name="InnerShadow" Grid.RowSpan="2" Grid.ColumnSpan="2">
                            <Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}" />
                            <Border x:Name="Halo" CornerRadius="12" Background="{TemplateBinding BorderBrush}" OpacityMask="{StaticResource HaloMask}" />
                        </Grid>
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
                            <ContentPresenter.RenderTransform>
                                <TransformGroup>
                                    <TranslateTransform X="0" Y="0" />
                                </TransformGroup>
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderThickness" TargetName="Background" Value="0.5,0.5,0.5,0.5" />
                            <Setter Property="Opacity" TargetName="InnerShadow" Value="0.65" />
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.35" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <!--CheckBox-->
    <SolidColorBrush x:Key="CheckBoxBorderBrush" Color="#C0C0C0" />
    <Style TargetType="{x:Type CheckBox}">
        <Setter Property="SnapsToDevicePixels" Value="true" />
        <Setter Property="Background" Value="{DynamicResource WindowsBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrush}" />
        <Setter Property="Content" Value="CheckBox" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Padding" Value="4,1,0,0" />
        <Setter Property="BorderThickness" Value="0.5,0.5,1.5,1.5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2" To="MouseOver" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="00:00:00.2" />
                                    <VisualTransition GeneratedDuration="00:00:00" To="Pressed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="1.5,1.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="IndeterminateRectangle" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Focus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid Height="16" HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="16" x:Name="grid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border x:Name="Border" Grid.RowSpan="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" CornerRadius="2,2,2,2" Background="{TemplateBinding Background}" />
                            <Border x:Name="Shadow" Grid.RowSpan="1" Background="{TemplateBinding BorderBrush}" CornerRadius="2,2,2,2">
                                <Border.OpacityMask>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#59FFFFFF" Offset="0" />
                                        <GradientStop Color="#59FFFFFF" Offset="1" />
                                        <GradientStop Color="#00FFFFFF" Offset="0.393" />
                                        <GradientStop Color="#00FFFFFF" Offset="0.567" />
                                    </LinearGradientBrush>
                                </Border.OpacityMask>
                            </Border>
                            <Grid Opacity="0.8" Visibility="Collapsed" x:Name="Bullet" Margin="-0.25,-0.25,0,0" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.RowSpan="1">
                                <Path Fill="{TemplateBinding Foreground}" Data="M1.6045539,4.9657478 L3.9166667,6.7270508 L8.7999792,0.13644244 L10.335848,1.2280303 L4.1581869,9.0391064 L0.39386681,6.6038928 z" Margin="1.75,1.49,1.94,1.427" Stretch="Fill" StrokeLineJoin="Miter" StrokeMiterLimit="10" VerticalAlignment="Stretch" />
                            </Grid>
                            <Rectangle Stroke="{x:Null}" StrokeThickness="0" x:Name="IndeterminateRectangle" Fill="{StaticResource TextBrush}" Visibility="Collapsed" Height="3" Margin="4,4,4,4" Grid.RowSpan="2" RadiusX="1" RadiusY="1" />
                            <Border BorderBrush="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource FocusMask}" CornerRadius="4,4,4,4" BorderThickness="1,1,1,1" Margin="-3,-3,-2.75,-2.75" x:Name="Focus" Visibility="Collapsed" />
                        </Grid>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" Grid.Column="1" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="grid" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--RadioButton-->
    <SolidColorBrush x:Key="RadioButtonBorderBrush" Color="#C0C0C0" />

    <Style TargetType="{x:Type RadioButton}">
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource WindowsBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" />
        <Setter Property="BorderThickness" Value="0.5,0.5,1.5,1.5" />
        <Setter Property="Padding" Value="4,1,0,0" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RadioButton}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerBorder" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.6" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="1.5,1.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.55" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.2" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Bullet" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Focus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid Height="16" Width="16" x:Name="grid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0.5,0.5,1.5,1.5" CornerRadius="8" x:Name="Background" Opacity="1" Grid.RowSpan="1" Background="{TemplateBinding Background}" />
                            <Border Background="{TemplateBinding BorderBrush}" CornerRadius="8,8,8,8" x:Name="InnerBorder" Grid.RowSpan="1">
                                <Border.OpacityMask>
                                    <RadialGradientBrush>
                                        <GradientStop Color="#00000000" Offset="0.223" />
                                        <GradientStop Color="#66FFFFFF" Offset="1" />
                                    </RadialGradientBrush>
                                </Border.OpacityMask>
                            </Border>
                            <Border CornerRadius="13,13,13,13" x:Name="Focus" Margin="-3,-3,-2.75,-2.75" Grid.RowSpan="1" BorderThickness="1,1,1,1" BorderBrush="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource FocusMask}" Visibility="Collapsed" />
                            <Grid Width="8" Height="8" Visibility="Collapsed" x:Name="Bullet" Margin="-0.25,-0.25,0,0" RenderTransformOrigin="0.5,0.5">
                                <Grid.RenderTransform>
                                    <TransformGroup>
                                        <TranslateTransform />
                                    </TransformGroup>
                                </Grid.RenderTransform>
                                <Path Fill="{TemplateBinding Foreground}" Stretch="Fill" Data="M4.0000014,5.9604645E-07 C2.8954322,5.364418E-07 2.0000014,0.89543074 2.0000014,2.0000005 C2.0000014,3.1045699 2.895432,4.0000005 4.0000014,4.0000005 C5.1045709,4.0000005 6.0000014,3.1045697 6.0000014,2.0000005 C6.0000014,0.89543092 5.1045709,5.364418E-07 4.0000014,5.9604645E-07 z M4,0 C6.2091379,0 8,1.7908604 8,4 C8,6.2091393 6.2091393,8 4,8 C1.7908604,8 0,6.2091379 0,4 C0,1.7908616 1.7908616,0 4,0 z" />
                            </Grid>
                        </Grid>
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" Grid.Column="1" Margin="{TemplateBinding Padding}" IsEnabled="False" Content="{TemplateBinding Content}" x:Name="contentPresenter" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="grid" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Expander-->
    <Style TargetType="{x:Type Expander}">
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{x:Null}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="BorderBrush" Value="#00FFFFFF" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <ControlTemplate.Resources>
                        <ControlTemplate TargetType="{x:Type ToggleButton}" x:Key="ExpanderRightHeaderTemplate">
                            <Border Padding="{TemplateBinding Padding}">
                                <Grid SnapsToDevicePixels="False" Background="Transparent">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="19" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <Grid>
                                        <Grid.LayoutTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <TransformCollection>
                                                        <RotateTransform Angle="-90" />
                                                    </TransformCollection>
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Grid.LayoutTransform>
                                        <Grid Width="16" Height="16">
                                            <Grid.LayoutTransform>
                                                <TransformGroup>
                                                    <RotateTransform Angle="90" />
                                                </TransformGroup>
                                            </Grid.LayoutTransform>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Border CornerRadius="8,8,8,8" x:Name="White" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="0.75,0.75,1.25,1.25" Grid.RowSpan="1" Width="16" Height="16" Margin="0,0,-1,-1">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="1.438,0.5" StartPoint="-0.438,0.5">
                                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.018" />
                                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.25" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                        </Grid>
                                        <Path Stroke="{DynamicResource SecondaryBrush}" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5" RenderTransformOrigin="0.5,0.5">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleX="1" ScaleY="-1" />
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Grid>
                                    <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="RenderTransformOrigin" TargetName="arrow" Value="0.5,0.5" />
                                    <Setter Property="RenderTransform" TargetName="arrow">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="1" ScaleY="1" />
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="1.438,0.5" StartPoint="-0.438,0.5">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.219" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.522" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.518" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderThickness" TargetName="White" Value="1.5,1.5,0.5,0.5" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="1.438,0.5" StartPoint="-0.438,0.5">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.018" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.594" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                        <ControlTemplate x:Key="ExpanderUpHeaderTemplate" TargetType="{x:Type ToggleButton}">
                            <Border Padding="{TemplateBinding Padding}">
                                <Grid SnapsToDevicePixels="False" Background="Transparent">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="19" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Grid Width="16" Height="16">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Border CornerRadius="8,8,8,8" x:Name="White" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1.25,1.25,0.75,0.75" Grid.RowSpan="1" Width="16" Height="16" Margin="-1,-1,0,0">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,-0.508" StartPoint="0.5,1.508">
                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.299" />
                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <Path StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5" Grid.RowSpan="1" RenderTransformOrigin="0.5,0.5" Stroke="{DynamicResource SecondaryBrush}">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Grid>
                                    <ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="RenderTransform" TargetName="arrow">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="1" ScaleY="-1" />
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,-0.508" StartPoint="0.5,1.508">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.33" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.531" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.5" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderThickness" TargetName="White" Value="1.5,1.5,0.5,0.5" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,-0.508" StartPoint="0.5,1.508">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.647" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                        <ControlTemplate TargetType="{x:Type ToggleButton}" x:Key="ExpanderLeftHeaderTemplate">
                            <Border Padding="{TemplateBinding Padding}">
                                <Grid SnapsToDevicePixels="False" Background="Transparent">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="19" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <Grid>
                                        <Grid.LayoutTransform>
                                            <TransformGroup>
                                                <TransformGroup.Children>
                                                    <TransformCollection>
                                                        <RotateTransform Angle="90" />
                                                    </TransformCollection>
                                                </TransformGroup.Children>
                                            </TransformGroup>
                                        </Grid.LayoutTransform>
                                        <Grid Width="16" Height="16">
                                            <Grid.LayoutTransform>
                                                <TransformGroup>
                                                    <RotateTransform Angle="-90" />
                                                </TransformGroup>
                                            </Grid.LayoutTransform>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="*" />
                                            </Grid.RowDefinitions>
                                            <Border CornerRadius="8,8,8,8" x:Name="White" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="0.75,0.75,1.25,1.25" Grid.RowSpan="1" Width="16" Height="16" Margin="0,0,-1,-1">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="-0.852,0.5" StartPoint="1.852,0.5">
                                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.299" />
                                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <Path Stroke="{DynamicResource SecondaryBrush}" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5" RenderTransformOrigin="0.5,0.5" Grid.RowSpan="1">
                                                <Path.RenderTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform ScaleX="-1" ScaleY="1" />
                                                        <RotateTransform Angle="-90" />
                                                    </TransformGroup>
                                                </Path.RenderTransform>
                                            </Path>
                                        </Grid>
                                    </Grid>
                                    <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" SnapsToDevicePixels="True" Grid.Row="1" RecognizesAccessKey="True" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="true">
                                    <Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="-0.852,0.5" StartPoint="1.852,0.5">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.562" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="BorderThickness" TargetName="White" Value="1.5,1.5,0.5,0.5" />
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="-0.852,0.5" StartPoint="1.852,0.5">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.357" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.54" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.518" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                        <ControlTemplate TargetType="{x:Type ToggleButton}" x:Key="ExpanderDownHeaderTemplate">
                            <Border Padding="{TemplateBinding Padding}">
                                <Grid SnapsToDevicePixels="False" Background="Transparent">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="19" />
                                        <ColumnDefinition Width="*" />
                                    </Grid.ColumnDefinitions>
                                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="19" Height="19">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Border CornerRadius="8,8,8,8" x:Name="White" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="0.75,0.75,1.25,1.25" Grid.RowSpan="1" Width="16" Height="16" Margin="0,0,-1,-1">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1.531" StartPoint="0.5,-0.615">
                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.308" />
                                                </LinearGradientBrush>
                                            </Border.Background>
                                        </Border>
                                        <Path Stroke="{DynamicResource SecondaryBrush}" StrokeThickness="2" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" SnapsToDevicePixels="false" Data="M 1,1.5 L 4.5,5 L 8,1.5" Grid.RowSpan="1" RenderTransformOrigin="0.5,0.5">
                                            <Path.RenderTransform>
                                                <TransformGroup>
                                                    <ScaleTransform ScaleX="1" ScaleY="-1" />
                                                </TransformGroup>
                                            </Path.RenderTransform>
                                        </Path>
                                    </Grid>
                                    <ContentPresenter HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" SnapsToDevicePixels="True" Grid.Column="1" RecognizesAccessKey="True" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="True">
                                    <Setter Property="RenderTransformOrigin" TargetName="arrow" Value="0.5,0.5" />
                                    <Setter Property="RenderTransform" TargetName="arrow">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="1" ScaleY="1" />
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsPressed" Value="True">
                                    <Setter Property="BorderThickness" TargetName="White" Value="1.5,1.5,0.5,0.5" />
                                    <Setter Property="RenderTransform" TargetName="arrow">
                                        <Setter.Value>
                                            <TransformGroup>
                                                <ScaleTransform ScaleX="1" ScaleY="1" />
                                                <TranslateTransform X="0.5" Y="0.5" />
                                            </TransformGroup>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1.531" StartPoint="0.5,-0.615">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.362" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.509" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.598" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" TargetName="White">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1.531" StartPoint="0.5,-0.615">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.013" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.665" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsFocused" Value="True">
                                    <Setter Property="BorderThickness" TargetName="White" Value="0.75,0.75,2,2" />
                                    <Setter Property="Margin" TargetName="White" Value="0,0,-1.25,-1.25" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </ControlTemplate.Resources>
                    <Border SnapsToDevicePixels="true" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" x:Name="border" Background="#00A7A6A6">
                        <DockPanel>
                            <ToggleButton Margin="1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" Template="{StaticResource ExpanderDownHeaderTemplate}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DockPanel.Dock="Top" Background="#FF000000" BorderBrush="{TemplateBinding BorderBrush}" Opacity="1" />
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Focusable="false" Visibility="Collapsed" />
                        </DockPanel>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="true">
                            <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Right">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right" />
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left" />
                            <Setter Property="Template" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderTemplate}" />
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Up">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top" />
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom" />
                            <Setter Property="Template" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderTemplate}" />
                        </Trigger>
                        <Trigger Property="ExpandDirection" Value="Left">
                            <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left" />
                            <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right" />
                            <Setter Property="Template" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderTemplate}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="ExpandSite" Value="0.5" />
                            <Setter Property="Opacity" TargetName="HeaderSite" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <!-- TextBox -->
    <SolidColorBrush x:Key="TextBorderBrush" Color="#cfcfcf" />

    <Style TargetType="{x:Type TextBox}">

        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource SecondaryColor}" />
        <Setter Property="BorderBrush" Value="{DynamicResource TextBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="MinWidth" Value="0" />
        <Setter Property="MinHeight" Value="0" />
        <!--<Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type TextBox}">
                <Grid>
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal" />
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Disabled">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="PART_ContentHost" Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                    </DoubleAnimationUsingKeyFrames>
                                    <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderThickness)">
                                        <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                    </ThicknessAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="ReadOnly" />
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusedStates">
                            <VisualState x:Name="Focused">
                                <Storyboard>
                                    <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderThickness)">
                                        <SplineThicknessKeyFrame KeyTime="0" Value="1.75,2,0.5,0.5" />
                                    </ThicknessAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Visibility)">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Unfocused" />
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border Background="{TemplateBinding Background}" x:Name="White" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" BorderThickness="1,1.5,0.5,0.5" />
                    <Grid x:Name="InnerShadow">
                        <Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" OpacityMask="{DynamicResource BoxBottomShadowMask}" />
                        <Border x:Name="Halo" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" OpacityMask="{DynamicResource HaloMask}" />
                    </Grid>
                    <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                    <Border CornerRadius="7,7,7,7" Margin="-3,-3,-3,-3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" OpacityMask="{DynamicResource FocusMask}" Visibility="Collapsed" x:Name="border" />
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="BorderThickness" TargetName="White" Value="0.5,0.5,0.5,0.5" />
                        <Setter Property="Opacity" TargetName="InnerShadow" Value="0.65" />
                        <Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.35" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter> -->
    </Style>

    <!-- PasswordBox -->
    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="FontFamily" Value="Times New Roman" />
        <Setter Property="PasswordChar" Value="●" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type PasswordBox}">
                    <Grid>
                        <Border x:Name="Background" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" CornerRadius="4,4,4,4" />
                        <Grid x:Name="grid">
                            <Border x:Name="BottomShadow" OpacityMask="{DynamicResource BoxBottomShadowMask}" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" />
                            <Border x:Name="Halo" OpacityMask="{DynamicResource HaloMask}" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" />
                        </Grid>
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Border Margin="-3,-3,-3,-3" x:Name="Focus" OpacityMask="{DynamicResource FocusMask}" Visibility="Collapsed" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" CornerRadius="7,7,7,7" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" TargetName="grid" Value="0.5" />
                        </Trigger>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderThickness" TargetName="Background" Value="1.75,2,0.5,0.5" />
                            <Setter Property="Visibility" TargetName="Focus" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="BorderThickness" TargetName="Background" Value="0.5,0.5,0.5,0.5" />
                            <Setter Property="Opacity" TargetName="grid" Value="0.65" />
                            <Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.35" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- RichTextBox -->
    <Style TargetType="{x:Type RichTextBox}">
        <Style.Resources>
            <Style x:Key="{x:Type FlowDocument}" TargetType="{x:Type FlowDocument}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
            </Style>
        </Style.Resources>
        <Setter Property="MinWidth" Value="10" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="AllowDrop" Value="true" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TextBoxBase}">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="PART_ContentHost" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusedStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                            <SplineThicknessKeyFrame KeyTime="0" Value="1.75,2,0.5,0.5" />
                                        </ThicknessAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Focus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="UnFocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border CornerRadius="4,4,4,4" BorderThickness="1,1.5,0.5,0.5" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" x:Name="Background" />
                        <Grid x:Name="grid">
                            <Border Margin="0,0,0,0" CornerRadius="4,4,4,4" Background="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource BoxBottomShadowMask}" x:Name="Shadow" />
                            <Border Margin="0,0,0,0" x:Name="Halo" CornerRadius="4,4,4,4" Background="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource HaloMask}" />
                        </Grid>
                        <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        <Border x:Name="Focus" BorderThickness="1,1,1,1" CornerRadius="7,7,7,7" Margin="-3,-3,-3,-3" BorderBrush="{DynamicResource SecondaryBrush}" OpacityMask="{DynamicResource FocusMask}" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Thumb -->
    <Style TargetType="{x:Type Thumb}">
        <Setter Property="OverridesDefaultStyle" Value="true" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Background" Value="#FF1F3B53" />
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Margin="1,0,3,2" x:Name="grid">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border CornerRadius="8,8,8,8" Opacity="1" x:Name="Background" BorderThickness="0.5,0.5,1.5,1.5" BorderBrush="{TemplateBinding BorderBrush}">
                            <Border.Background>
                                <RadialGradientBrush>
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.714" ScaleY="2.148" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.121" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </RadialGradientBrush>
                            </Border.Background>
                        </Border>
                        <Border CornerRadius="8,8,8,8" Background="white" Opacity="0" x:Name="DisableEllipse" />
                        <Border x:Name="HasFocus" CornerRadius="13" BorderThickness="1" Visibility="Collapsed" OpacityMask="{StaticResource FocusMask}" BorderBrush="{TemplateBinding BorderBrush}" Margin="-2,-2,-2,-2" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter Property="BorderThickness" TargetName="Background" Value="1,1,1,1" />
                            <Setter Property="Background" TargetName="Background">
                                <Setter.Value>
                                    <RadialGradientBrush>
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.531" ScaleY="1.918" />
                                                <TranslateTransform X="-0.037" Y="-0.04" />
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.121" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.491" />
                                    </RadialGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Visibility" TargetName="HasFocus" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Opacity" TargetName="Background" Value="1" />
                            <Setter Property="Background" TargetName="Background">
                                <Setter.Value>
                                    <RadialGradientBrush>
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.531" ScaleY="1.918" />
                                                <TranslateTransform X="-0.037" Y="-0.04" />
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.397" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.674" />
                                    </RadialGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsDragging" Value="true">
                            <Setter Property="Background" TargetName="Background">
                                <Setter.Value>
                                    <RadialGradientBrush>
                                        <RadialGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.531" ScaleY="1.918" />
                                                <TranslateTransform X="-0.037" Y="-0.04" />
                                            </TransformGroup>
                                        </RadialGradientBrush.RelativeTransform>
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.362" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.54" />
                                    </RadialGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderThickness" TargetName="Background" Value="1.75,1.75,0.5,0.5" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="DisableEllipse" Value="0.65" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Focusable" Value="True" />
    </Style>

    <!-- Slider -->
    <Style TargetType="{x:Type Slider}">
        <Style.Resources>
            <Style x:Key="SliderRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Focusable" Value="false" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <Rectangle Fill="Transparent" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Style.Resources>
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Foreground" Value="#FFC4C4C4" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Slider}">
                    <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <TickBar x:Name="TopTick" Height="4" Visibility="Collapsed" Fill="{TemplateBinding Foreground}" Placement="Top" />
                            <TickBar x:Name="BottomTick" Height="4" Visibility="Collapsed" Grid.Row="2" Fill="{TemplateBinding Foreground}" Placement="Bottom" />
                            <Border Margin="5,0" x:Name="TrackBackground" VerticalAlignment="center" Height="4.0" Grid.Row="1" Background="{DynamicResource SecondaryBrush}" BorderBrush="{x:Null}" BorderThickness="1" CornerRadius="1">
                                <Canvas Margin="-6,-1">
                                    <Rectangle StrokeThickness="1.0" x:Name="PART_SelectionRange" Height="4.0" Visibility="Hidden" />
                                </Canvas>
                            </Border>
                            <Track x:Name="PART_Track" Grid.Row="1">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}" />
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}" />
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb x:Name="Thumb" Width="18" Height="18" />
                                </Track.Thumb>
                            </Track>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TickPlacement" Value="TopLeft">
                            <Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
                        </Trigger>
                        <Trigger Property="TickPlacement" Value="BottomRight">
                            <Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
                        </Trigger>
                        <Trigger Property="TickPlacement" Value="Both">
                            <Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
                            <Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsSelectionRangeEnabled" Value="true">
                            <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsKeyboardFocused" Value="true">
                            <Setter Property="Foreground" TargetName="Thumb" Value="Blue" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Slider}">
                            <Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition MinWidth="{TemplateBinding MinWidth}" Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <TickBar x:Name="TopTick" Width="4" Visibility="Collapsed" Fill="{TemplateBinding Foreground}" Placement="Left" />
                                    <TickBar x:Name="BottomTick" Width="4" Visibility="Collapsed" Grid.Column="2" Fill="{TemplateBinding Foreground}" Placement="Right" />
                                    <Border HorizontalAlignment="center" Margin="0,5" x:Name="TrackBackground" Width="4.0" Grid.Column="1" BorderThickness="1" CornerRadius="1" Background="{DynamicResource SecondaryBrush}" BorderBrush="{x:Null}">
                                        <Canvas Margin="-1,-6">
                                            <Rectangle StrokeThickness="1.0" x:Name="PART_SelectionRange" Width="4.0" Visibility="Hidden" />
                                        </Canvas>
                                    </Border>
                                    <Track x:Name="PART_Track" Grid.Column="1">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.DecreaseLarge}" />
                                        </Track.DecreaseRepeatButton>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton Style="{StaticResource SliderRepeatButtonStyle}" Command="{x:Static Slider.IncreaseLarge}" />
                                        </Track.IncreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb x:Name="Thumb" RenderTransformOrigin="0.5,0.5" Width="18" Height="18" />
                                        </Track.Thumb>
                                    </Track>
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="TickPlacement" Value="TopLeft">
                                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
                                </Trigger>
                                <Trigger Property="TickPlacement" Value="BottomRight">
                                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
                                </Trigger>
                                <Trigger Property="TickPlacement" Value="Both">
                                    <Setter Property="Visibility" TargetName="TopTick" Value="Visible" />
                                    <Setter Property="Visibility" TargetName="BottomTick" Value="Visible" />
                                </Trigger>
                                <Trigger Property="IsSelectionRangeEnabled" Value="true">
                                    <Setter Property="Visibility" TargetName="PART_SelectionRange" Value="Visible" />
                                </Trigger>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter Property="Foreground" TargetName="Thumb" Value="Blue" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- ScrollBar -->
    <Style TargetType="{x:Type ScrollBar}">
        <Style.Resources>
            <Style x:Key="ScrollBarButton" TargetType="{x:Type RepeatButton}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Focusable" Value="false" />
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <Border Background="{TemplateBinding Background}" BorderBrush="{DynamicResource ButtonBorderBrush}" BorderThickness="1">
                                <Path Fill="{TemplateBinding Foreground}" Stretch="Fill" Stroke="{x:Null}" Width="8" Height="4" Data="M3.9375,0.5 L7.5,3.5 0.5,3.5 z" />
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Background" Value="Transparent" />
                <Setter Property="Focusable" Value="false" />
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Grid x:Name="grid">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Rectangle Stroke="{DynamicResource ButtonBorderBrush}" StrokeThickness="0.5" Grid.RowSpan="1" x:Name="Background">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush EndPoint="1.629,0.503" StartPoint="0.004,0.5">
                                            <GradientStop Color="{DynamicResource WindowBackgroundColor}" Offset="0" />
                                            <GradientStop Color="{DynamicResource WindowBackgroundColor}" Offset="1" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle Stroke="{x:Null}" Grid.RowSpan="1" Visibility="Collapsed" x:Name="Disable">
                                    <Rectangle.Fill>
                                        <SolidColorBrush Color="{DynamicResource DisabledColor}" />
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                            <!--<ControlTemplate.Triggers>
                            <Trigger Property="IsDragging" Value="True">
                                <Setter Property="Fill" TargetName="Background">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="1.629,0.503" StartPoint="0.004,0.5">
                                            <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.21" />
                                            <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="Visibility" TargetName="Disable" Value="Visible" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True" SourceName="Background">
                                <Setter Property="Fill" TargetName="Background">
                                    <Setter.Value>
                                        <LinearGradientBrush EndPoint="1.629,0.503" StartPoint="0.004,0.5">
                                            <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.625" />
                                            <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                            </Trigger>
                        </ControlTemplate.Triggers>-->
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Style.Resources>
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="false" />
        <Setter Property="Foreground" Value="#FF000000" />
        <Setter Property="Width" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
        <Setter Property="MinWidth" Value="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <Grid x:Name="Bg" SnapsToDevicePixels="true">
                        <Grid.RowDefinitions>
                            <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
                            <RowDefinition Height="*" />
                            <RowDefinition MaxHeight="{DynamicResource {x:Static SystemParameters.VerticalScrollBarButtonHeightKey}}" />
                        </Grid.RowDefinitions>
                        <Border Grid.RowSpan="3" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="0.5,0.5,1.5,1.5" CornerRadius="8,8,8,8">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="1.046,0.517" StartPoint="-0.087,0.476">
                                    <!--<GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                <GradientStop Color="#FFFFF7EC" Offset="1" />-->
                                    <GradientStop Color="White" Offset="0" />
                                    <GradientStop Color="White" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <RepeatButton Style="{StaticResource ScrollBarButton}" IsEnabled="{TemplateBinding IsMouseOver}" Command="{x:Static ScrollBar.LineUpCommand}" />
                        <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1" IsDirectionReversed="true">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="{x:Static ScrollBar.PageUpCommand}" Background="{DynamicResource SecondaryBrush}">
                                    <RepeatButton.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,0.105" StartPoint="0.5,0.96">
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                            <GradientStop Color="#59FFFFFF" Offset="0.339" />
                                        </LinearGradientBrush>
                                    </RepeatButton.OpacityMask>
                                </RepeatButton>
                            </Track.DecreaseRepeatButton>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="{x:Static ScrollBar.PageDownCommand}" Background="{DynamicResource SecondaryBrush}">
                                    <RepeatButton.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#A5000000" Offset="0" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                            <GradientStop Color="#592F2F2F" Offset="0.232" />
                                        </LinearGradientBrush>
                                    </RepeatButton.OpacityMask>
                                </RepeatButton>
                            </Track.IncreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Style="{StaticResource ScrollBarThumb}" x:Name="thumb" Margin="0,0,0.5,0" BorderThickness="1,1,1,1" />
                            </Track.Thumb>
                        </Track>
                        <RepeatButton Style="{StaticResource ScrollBarButton}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" RenderTransformOrigin="0.5,0.5">
                            <RepeatButton.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1" ScaleY="-1" />
                                </TransformGroup>
                            </RepeatButton.RenderTransform>
                        </RepeatButton>
                        <Border BorderBrush="{DynamicResource SecondaryBrush}" CornerRadius="8,8,8,8" Grid.RowSpan="3" x:Name="DisableLayer" Visibility="Collapsed">
                            <Border.Background>
                                <SolidColorBrush Color="{DynamicResource DisabledColor}" />
                            </Border.Background>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Visibility" TargetName="DisableLayer" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Height" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" />
                <Setter Property="MinHeight" Value="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarHeightKey}}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
                                    <ColumnDefinition Width="0.00001*" />
                                    <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}" />
                                </Grid.ColumnDefinitions>
                                <Border Grid.ColumnSpan="3" Grid.RowSpan="1" BorderThickness="0.5,0.5,1.5,1.5" CornerRadius="8,8,8,8">
                                    <Border.Background>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                            <GradientStop Color="#FFFFF7EC" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                                <RepeatButton Style="{StaticResource ScrollBarButton}" IsEnabled="{TemplateBinding IsMouseOver}" Command="{x:Static ScrollBar.LineLeftCommand}">
                                    <RepeatButton.LayoutTransform>
                                        <TransformGroup>
                                            <RotateTransform Angle="-90" />
                                        </TransformGroup>
                                    </RepeatButton.LayoutTransform>
                                </RepeatButton>
                                <Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Column="1">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="{x:Static ScrollBar.PageLeftCommand}" Background="{DynamicResource SecondaryBrush}">
                                            <RepeatButton.OpacityMask>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#A5000000" Offset="0" />
                                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                                    <GradientStop Color="#593A3A3A" Offset="0.254" />
                                                </LinearGradientBrush>
                                            </RepeatButton.OpacityMask>
                                        </RepeatButton>
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="{x:Static ScrollBar.PageRightCommand}" Background="{DynamicResource SecondaryBrush}">
                                            <RepeatButton.OpacityMask>
                                                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                                    <GradientStop Color="#A5000000" Offset="0" />
                                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                                    <GradientStop Color="#595C5C5C" Offset="0.304" />
                                                </LinearGradientBrush>
                                            </RepeatButton.OpacityMask>
                                        </RepeatButton>
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb Style="{StaticResource ScrollBarThumb}" />
                                    </Track.Thumb>
                                </Track>
                                <RepeatButton Style="{StaticResource ScrollBarButton}" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Column="2" Command="{x:Static ScrollBar.LineRightCommand}">
                                    <RepeatButton.LayoutTransform>
                                        <TransformGroup>
                                            <RotateTransform Angle="90" />
                                        </TransformGroup>
                                    </RepeatButton.LayoutTransform>
                                </RepeatButton>
                                <Border CornerRadius="8,8,8,8" Grid.ColumnSpan="3" x:Name="DisableLayer" Visibility="Collapsed">
                                    <Border.Background>
                                        <SolidColorBrush Color="{DynamicResource DisabledColor}" />
                                    </Border.Background>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Visibility" TargetName="DisableLayer" Value="Visible" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Setter Property="Width" Value="Auto" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- ScrollViewer -->
    <Style TargetType="{x:Type ScrollViewer}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Rectangle Fill="{TemplateBinding Background}" x:Name="Corner" Grid.Column="1" Grid.Row="1" />
                        <ScrollContentPresenter Margin="{TemplateBinding Padding}" x:Name="PART_ScrollContentPresenter" Grid.Column="0" Grid.Row="0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" />
                        <ScrollBar Cursor="Arrow" x:Name="PART_VerticalScrollBar" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Grid.Column="1" Grid.Row="0" ViewportSize="{TemplateBinding ViewportHeight}" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="VerticalScrollBar" />
                        <ScrollBar Cursor="Arrow" x:Name="PART_HorizontalScrollBar" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="1" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding Path=HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Background" Value="#00FFFFFF" />
    </Style>

    <!-- FlowDocumentScrollViewer -->
    <Style TargetType="{x:Type FlowDocumentScrollViewer}">
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type FlowDocumentScrollViewer}">
                    <Grid Language="en-us" Uid="Grid_26">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Border Margin="{TemplateBinding Padding}" Uid="Border_49" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4,4,4,4" Background="{TemplateBinding Background}">
                            <ScrollViewer HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="PART_ContentHost" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Uid="ScrollViewer_8" CanContentScroll="True" />
                        </Border>
                        <Border x:Name="PART_ToolBarHost" Uid="Border_51" Grid.Row="1" Background="{TemplateBinding Background}">
                            <Grid Uid="Grid_34">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Border HorizontalAlignment="Left" x:Name="PART_FindToolBarHost" VerticalAlignment="Center" Uid="Border_61" Visibility="Collapsed" />
                                <Grid HorizontalAlignment="Right" VerticalAlignment="Center" Uid="Grid_27" Grid.Column="1">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <RepeatButton ToolTip="Decrease Zoom" Width="{TemplateBinding FontSize}" Height="{TemplateBinding FontSize}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}" IsEnabled="{TemplateBinding CanDecreaseZoom}" Uid="RepeatButton_7" Command="NavigationCommands.DecreaseZoom">
                                        <RepeatButton.Style>
                                            <Style TargetType="{x:Type RepeatButton}">
                                                <Setter Property="Padding" Value="2,2,0,2" />
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                            <Border Uid="Border_41" Background="#00FFFFFF" Padding="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}">
                                                                <Viewbox x:Name="Content" RenderTransformOrigin="0.5,0.5" Uid="Viewbox_2">
                                                                    <Grid Width="32" Height="32" Uid="Canvas_4">
                                                                        <Grid.RowDefinitions>
                                                                            <RowDefinition Height="*" />
                                                                        </Grid.RowDefinitions>
                                                                        <Border Grid.RowSpan="1" CornerRadius="16,16,16,16" BorderThickness="1.5,1.5,0.5,0.5" BorderBrush="{DynamicResource SecondaryBrush}" x:Name="border">
                                                                            <Border.Background>
                                                                                <RadialGradientBrush>
                                                                                    <RadialGradientBrush.RelativeTransform>
                                                                                        <TransformGroup>
                                                                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.788" ScaleY="1.788" />
                                                                                        </TransformGroup>
                                                                                    </RadialGradientBrush.RelativeTransform>
                                                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                                                </RadialGradientBrush>
                                                                            </Border.Background>
                                                                        </Border>
                                                                        <Path StrokeThickness="3" Uid="Path_9" HorizontalAlignment="Right" Margin="0,15.993,6,13.507" VerticalAlignment="Stretch" Stroke="{DynamicResource SecondaryBrush}">
                                                                            <Path.Data>
                                                                                <LineGeometry EndPoint="10,0" StartPoint="-10,0" />
                                                                            </Path.Data>
                                                                        </Path>
                                                                    </Grid>
                                                                </Viewbox>
                                                            </Border>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter Property="Background" TargetName="border">
                                                                        <Setter.Value>
                                                                            <RadialGradientBrush>
                                                                                <RadialGradientBrush.RelativeTransform>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.788" ScaleY="1.788" />
                                                                                    </TransformGroup>
                                                                                </RadialGradientBrush.RelativeTransform>
                                                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.5" />
                                                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                                            </RadialGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                </Trigger>
                                                                <Trigger Property="IsPressed" Value="True">
                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                        <Setter.Value>
                                                                            <ScaleTransform ScaleX="1" ScaleY="1" />
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="Background" TargetName="border">
                                                                        <Setter.Value>
                                                                            <RadialGradientBrush>
                                                                                <RadialGradientBrush.RelativeTransform>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.788" ScaleY="1.788" />
                                                                                    </TransformGroup>
                                                                                </RadialGradientBrush.RelativeTransform>
                                                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.362" />
                                                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.741" />
                                                                            </RadialGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="BorderThickness" TargetName="border" Value="0.5,0.5,1.75,1.75" />
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
                                                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                                                <Setter Property="Opacity" Value="1" />
                                                <Style.BasedOn>
                                                    <Style TargetType="{x:Type RepeatButton}">
                                                        <Setter Property="Padding" Value="5,5,5,5" />
                                                        <Setter Property="Delay" Value="1000" />
                                                        <Setter Property="Interval" Value="250" />
                                                        <Style.BasedOn>
                                                            <Style TargetType="{x:Type ButtonBase}">
                                                                <Setter Property="Focusable" Value="False" />
                                                                <Setter Property="Opacity" Value="0.5" />
                                                                <Setter Property="Cursor" Value="Hand" />
                                                                <Setter Property="Background" Value="#00FFFFFF" />
                                                                <Setter Property="Padding" Value="3,1,3,1" />
                                                                <Setter Property="BorderBrush" Value="{x:Null}" />
                                                                <Setter Property="BorderThickness" Value="0,0,0,0" />
                                                                <Setter Property="MinWidth" Value="0" />
                                                                <Setter Property="MinHeight" Value="0" />
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate TargetType="{x:Type ButtonBase}">
                                                                            <Border Uid="Border_39" Background="{TemplateBinding Background}">
                                                                                <ContentPresenter x:Name="Content" RenderTransformOrigin="0.5,0.5" Uid="ContentPresenter_2" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                                            </Border>
                                                                            <ControlTemplate.Triggers>
                                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                                        <Setter.Value>
                                                                                            <ScaleTransform ScaleX="1.1" ScaleY="1.1" />
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Trigger>
                                                                                <Trigger Property="IsPressed" Value="True">
                                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                                        <Setter.Value>
                                                                                            <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Trigger>
                                                                            </ControlTemplate.Triggers>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Style.Triggers>
                                                                    <Trigger Property="IsEnabled" Value="False">
                                                                        <Setter Property="Opacity" Value="0.3" />
                                                                    </Trigger>
                                                                    <Trigger Property="IsMouseOver" Value="True">
                                                                        <Setter Property="Opacity" Value="1" />
                                                                    </Trigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Style.BasedOn>
                                                    </Style>
                                                </Style.BasedOn>
                                            </Style>
                                        </RepeatButton.Style>
                                        <RepeatButton.LayoutTransform>
                                            <ScaleTransform ScaleX="2.2" ScaleY="2.2" />
                                        </RepeatButton.LayoutTransform>
                                    </RepeatButton>
                                    <Slider HorizontalAlignment="Stretch" VerticalAlignment="Center" MinWidth="50" FontSize="{TemplateBinding FontSize}" Uid="Slider_2" Grid.Column="1" TickFrequency="{TemplateBinding ZoomIncrement}" LargeChange="{TemplateBinding ZoomIncrement}" Maximum="{TemplateBinding MaxZoom}" Minimum="{TemplateBinding MinZoom}" SmallChange="{TemplateBinding ZoomIncrement}" Value="{Binding Path=Zoom, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                                    <RepeatButton ToolTip="Increase Zoom" Width="{TemplateBinding FontSize}" Height="{TemplateBinding FontSize}" BorderBrush="{TemplateBinding BorderBrush}" Foreground="{TemplateBinding Foreground}" IsEnabled="{TemplateBinding CanIncreaseZoom}" Uid="RepeatButton_8" Grid.Column="2" Command="NavigationCommands.IncreaseZoom">
                                        <RepeatButton.Style>
                                            <Style TargetType="{x:Type RepeatButton}">
                                                <Setter Property="Padding" Value="2,2,0,2" />
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                                                            <Border Uid="Border_41" Background="#00FFFFFF" Padding="{Binding Path=Padding, RelativeSource={RelativeSource TemplatedParent}}">
                                                                <Viewbox x:Name="Content" RenderTransformOrigin="0.5,0.5" Uid="Viewbox_2">
                                                                    <Grid Width="32" Height="32" Uid="Canvas_4">
                                                                        <Grid.RowDefinitions>
                                                                            <RowDefinition Height="*" />
                                                                        </Grid.RowDefinitions>
                                                                        <Border Grid.RowSpan="1" BorderThickness="1.75,1.75,0.5,0.5" CornerRadius="16,16,16,16" BorderBrush="{DynamicResource SecondaryBrush}" x:Name="border">
                                                                            <Border.Background>
                                                                                <RadialGradientBrush>
                                                                                    <RadialGradientBrush.RelativeTransform>
                                                                                        <TransformGroup>
                                                                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.068" ScaleY="2.068" />
                                                                                        </TransformGroup>
                                                                                    </RadialGradientBrush.RelativeTransform>
                                                                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                                                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                                                </RadialGradientBrush>
                                                                            </Border.Background>
                                                                        </Border>
                                                                        <Path StrokeThickness="3" Uid="Path_12" Grid.RowSpan="1" HorizontalAlignment="Right" VerticalAlignment="Stretch" Margin="0,15.872,6,6" x:Name="path" Stroke="{DynamicResource SecondaryBrush}">
                                                                            <Path.Data>
                                                                                <GeometryGroup>
                                                                                    <LineGeometry EndPoint="10,0" StartPoint="-10,0" />
                                                                                    <LineGeometry EndPoint="0,10" StartPoint="0,-10" />
                                                                                </GeometryGroup>
                                                                            </Path.Data>
                                                                        </Path>
                                                                    </Grid>
                                                                </Viewbox>
                                                            </Border>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter Property="Background" TargetName="border">
                                                                        <Setter.Value>
                                                                            <RadialGradientBrush>
                                                                                <RadialGradientBrush.RelativeTransform>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.068" ScaleY="2.068" />
                                                                                    </TransformGroup>
                                                                                </RadialGradientBrush.RelativeTransform>
                                                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.5" />
                                                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                                            </RadialGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                </Trigger>
                                                                <Trigger Property="IsPressed" Value="True">
                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                        <Setter.Value>
                                                                            <ScaleTransform ScaleX="1" ScaleY="1" />
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="Background" TargetName="border">
                                                                        <Setter.Value>
                                                                            <RadialGradientBrush>
                                                                                <RadialGradientBrush.RelativeTransform>
                                                                                    <TransformGroup>
                                                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.068" ScaleY="2.068" />
                                                                                    </TransformGroup>
                                                                                </RadialGradientBrush.RelativeTransform>
                                                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.357" />
                                                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.612" />
                                                                            </RadialGradientBrush>
                                                                        </Setter.Value>
                                                                    </Setter>
                                                                    <Setter Property="BorderThickness" TargetName="border" Value="0.5,0.5,1.75,1.75" />
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
                                                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                                                <Setter Property="Opacity" Value="1" />
                                                <Style.BasedOn>
                                                    <Style TargetType="{x:Type RepeatButton}">
                                                        <Setter Property="Padding" Value="5,5,5,5" />
                                                        <Setter Property="Delay" Value="1000" />
                                                        <Setter Property="Interval" Value="250" />
                                                        <Style.BasedOn>
                                                            <Style TargetType="{x:Type ButtonBase}">
                                                                <Setter Property="Focusable" Value="False" />
                                                                <Setter Property="Opacity" Value="0.5" />
                                                                <Setter Property="Cursor" Value="Hand" />
                                                                <Setter Property="Background" Value="#00FFFFFF" />
                                                                <Setter Property="Padding" Value="3,1,3,1" />
                                                                <Setter Property="BorderBrush" Value="{x:Null}" />
                                                                <Setter Property="BorderThickness" Value="0,0,0,0" />
                                                                <Setter Property="MinWidth" Value="0" />
                                                                <Setter Property="MinHeight" Value="0" />
                                                                <Setter Property="Template">
                                                                    <Setter.Value>
                                                                        <ControlTemplate TargetType="{x:Type ButtonBase}">
                                                                            <Border Uid="Border_39" Background="{TemplateBinding Background}">
                                                                                <ContentPresenter x:Name="Content" RenderTransformOrigin="0.5,0.5" Uid="ContentPresenter_2" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                                                            </Border>
                                                                            <ControlTemplate.Triggers>
                                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                                        <Setter.Value>
                                                                                            <ScaleTransform ScaleX="1.1" ScaleY="1.1" />
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Trigger>
                                                                                <Trigger Property="IsPressed" Value="True">
                                                                                    <Setter Property="RenderTransform" TargetName="Content">
                                                                                        <Setter.Value>
                                                                                            <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
                                                                                        </Setter.Value>
                                                                                    </Setter>
                                                                                </Trigger>
                                                                            </ControlTemplate.Triggers>
                                                                        </ControlTemplate>
                                                                    </Setter.Value>
                                                                </Setter>
                                                                <Style.Triggers>
                                                                    <Trigger Property="IsEnabled" Value="False">
                                                                        <Setter Property="Opacity" Value="0.3" />
                                                                    </Trigger>
                                                                    <Trigger Property="IsMouseOver" Value="True">
                                                                        <Setter Property="Opacity" Value="1" />
                                                                    </Trigger>
                                                                </Style.Triggers>
                                                            </Style>
                                                        </Style.BasedOn>
                                                    </Style>
                                                </Style.BasedOn>
                                            </Style>
                                        </RepeatButton.Style>
                                        <RepeatButton.LayoutTransform>
                                            <ScaleTransform ScaleX="2.2" ScaleY="2.2" />
                                        </RepeatButton.LayoutTransform>
                                    </RepeatButton>
                                </Grid>
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ListBox -->
    <Style TargetType="{x:Type ListBox}">
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Border x:Name="Bd" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" Padding="1" CornerRadius="4,4,4,4">
                        <Grid x:Name="grid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Border BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4,4,4,4" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Opacity="1" x:Name="border" />
                            <Grid x:Name="Shadow">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="6" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="6" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="6" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="6" />
                                </Grid.ColumnDefinitions>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.655,0.644">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.489" ScaleY="3.489" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="-0.063" Y="-0.025" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-1.025">
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            <GradientStop Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,2.5,0,0" Grid.Column="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.283,0.71">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.805" ScaleY="2.805" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0.144" Y="-0.125" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="1,.5" StartPoint="-0.972,0.5">
                                            <GradientStop Color="#00000000" Offset="1" />
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" OpacityMask="#00000000" Grid.Column="1" Grid.Row="1" />
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="2.01,0.5">
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,0,2.5" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.646,0.361">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.438" ScaleY="3.438" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="-0.072" Y="0.072" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Margin="0,0,0,0" Grid.Column="1" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,2.065" StartPoint="0.5,0">
                                            <GradientStop Color="#00000000" Offset="0" />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,2.5,0" Grid.Column="2" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.287,0.495">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="4.282" ScaleY="3.792" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0.495" Y="-0.463" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                            </Grid>
                            <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false" Grid.ColumnSpan="1" Grid.RowSpan="1" Margin="4,4,4,4" Foreground="{DynamicResource TextBrush}" x:Name="scrollViewer">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                            </ScrollViewer>
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="border" Value="0.65" />
                            <Setter Property="Opacity" TargetName="scrollViewer" Value="0.65" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ListBoxItem -->
    <Style TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border x:Name="Bd" SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2000000" To="MouseOver" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="rectangleSelected" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="rectangleSelected" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.75" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="rectangle1" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid>
                            <Rectangle x:Name="rectangleSelected" Opacity="0" RadiusX="3" RadiusY="3" Stroke="{DynamicResource SecondaryBrush}">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle x:Name="rectangle" Opacity="0" Stroke="{DynamicResource SecondaryBrush}" RadiusX="3" RadiusY="3">
                                <Rectangle.Fill>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" />
                            <Rectangle Stroke="{DynamicResource SecondaryBrush}" Margin="0,0,0,0" RadiusX="3" RadiusY="3" Visibility="Collapsed" x:Name="rectangle1" />
                        </Grid>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="0.55" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TabControl -->
    <Style TargetType="{x:Type TabControl}">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="{DynamicResource WindowBackgroundColor}" Offset="0" />
                    <GradientStop Color="{DynamicResource WindowBackgroundColor}" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Padding" Value="4,4,4,4" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0" />
                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0" Height="Auto" />
                            <RowDefinition x:Name="RowDefinition1" Height="*" />
                        </Grid.RowDefinitions>
                        <TabPanel Margin="8,2,8,0" x:Name="HeaderPanel" IsItemsHost="true" Panel.ZIndex="1" KeyboardNavigation.TabIndex="1" />
                        <Border CornerRadius="4,4,4,4" x:Name="Background" Grid.Row="1" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1.522" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource BorderColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource BorderColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <Grid>
                                <Grid x:Name="Shadow">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="6" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="6" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="6" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="6" />
                                    </Grid.ColumnDefinitions>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.655,0.644">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.489" ScaleY="3.489" />
                                                        <TranslateTransform X="-0.063" Y="-0.025" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-1.025">
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                                <GradientStop Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,2.5,0,0" Grid.Column="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.283,0.71">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.805" ScaleY="2.805" />
                                                        <TranslateTransform X="0.144" Y="-0.125" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="1,.5" StartPoint="-0.972,0.5">
                                                <GradientStop Color="#00000000" Offset="1" />
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" OpacityMask="#00000000" Grid.Column="1" Grid.Row="1" />
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0,0.5" StartPoint="2.01,0.5">
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                                <GradientStop Color="#00FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,0,2.5" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.646,0.361">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.438" ScaleY="3.438" />
                                                        <TranslateTransform X="-0.072" Y="0.072" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Margin="0,0,0,0" Grid.Column="1" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0.5,2.065" StartPoint="0.5,0">
                                                <GradientStop Color="#00000000" Offset="0" />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,2.5,0" Grid.Column="2" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.287,0.495">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="4.282" ScaleY="3.792" />
                                                        <TranslateTransform X="0.495" Y="-0.463" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                </Grid>
                                <Border x:Name="ContentPanel" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
                                    <Grid Margin="6,6,6,6">
                                        <ContentPresenter Margin="1,1,1,1" x:Name="PART_SelectedContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="SelectedContent" />
                                    </Grid>
                                </Border>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="8,0,8,2" />
                            <Setter Property="CornerRadius" TargetName="ContentPanel" Value="3,3,0,0" />
                            <Setter Property="Grid.Row" TargetName="Background" Value="0" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1" />
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="2,8,0,8" />
                            <Setter Property="CornerRadius" TargetName="ContentPanel" Value="0,3,3,0" />
                            <Setter Property="Grid.Column" TargetName="Background" Value="1" />
                            <Setter Property="Grid.Row" TargetName="Background" Value="0" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="Margin" TargetName="HeaderPanel" Value="0,8,2,8" />
                            <Setter Property="CornerRadius" TargetName="ContentPanel" Value="3,0,0,3" />
                            <Setter Property="Grid.Row" TargetName="Background" Value="0" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="PART_SelectedContentHost" Value="0.5" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TabItem -->
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Padding" Value="6,1,6,1" />
        <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
        <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid SnapsToDevicePixels="true">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border Grid.RowSpan="1" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" CornerRadius="6,6,0,0" x:Name="Background" Opacity="0.65">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1.546" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.344" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <Border x:Name="BdSelected" CornerRadius="8,8,0,0" Visibility="Collapsed" Margin="-2,-2,-2,-6" Background="{TemplateBinding Background}">
                            <Border CornerRadius="7,7,0,0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Visibility="Collapsed" x:Name="borderSelected" Margin="0,0,0,5" />
                        </Border>
                        <ContentPresenter HorizontalAlignment="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" x:Name="Content" VerticalAlignment="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Grid.RowSpan="1" Margin="{TemplateBinding Padding}" />
                        <Border BorderBrush="{x:Null}" CornerRadius="8,8,0,0" x:Name="Disabled" Grid.RowSpan="1" Background="#8CFFFFFF" Visibility="Collapsed" Margin="-2,-2,-2,-2" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter Property="Opacity" TargetName="BdSelected" Value="0.8" />
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Panel.ZIndex" Value="1" />
                            <Setter Property="Visibility" TargetName="Background" Value="Collapsed" />
                            <Setter Property="Visibility" TargetName="BdSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="borderSelected" Value="Visible" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="false" />
                                <Condition Property="IsMouseOver" Value="true" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Background">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1.546" StartPoint="0.5,0">
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0.621" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="BorderThickness" TargetName="BdSelected" Value="1,0,1,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="0,0,3,3" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="0,0,3,3" />
                            <Setter Property="CornerRadius" TargetName="Background" Value="0,0,6,6" />
                            <Setter Property="BorderThickness" TargetName="Background" Value="1,0,1,1" />
                            <Setter Property="Margin" TargetName="Disabled" Value="0,0,0,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="0,0,6,6" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="BorderThickness" TargetName="BdSelected" Value="1,1,0,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="3,0,0,3" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="3,0,0,3" />
                            <Setter Property="CornerRadius" TargetName="Background" Value="6,0,0,6" />
                            <Setter Property="BorderThickness" TargetName="Background" Value="1,1,0,1" />
                            <Setter Property="Margin" TargetName="Disabled" Value="0,0,0,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="6,0,0,6" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="BorderThickness" TargetName="BdSelected" Value="0,1,1,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="0,3,3,0" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="0,3,3,0" />
                            <Setter Property="CornerRadius" TargetName="Background" Value="0,6,6,0" />
                            <Setter Property="BorderThickness" TargetName="Background" Value="0,1,1,1" />
                            <Setter Property="Margin" TargetName="Disabled" Value="0,0,0,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="0,6,6,0" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="TabStripPlacement" Value="Top" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Visibility" TargetName="Background" Value="Hidden" />
                            <Setter Property="Visibility" TargetName="BdSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="borderSelected" Value="Visible" />
                            <Setter Property="Margin" TargetName="BdSelected" Value="-2,0,-2,-6" />
                            <Setter Property="Margin" TargetName="Disabled" Value="-2,0,-2,-2" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="TabStripPlacement" Value="Bottom" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-1,-2,-2" />
                            <Setter Property="Margin" TargetName="Content" Value="6,1,6,1" />
                            <Setter Property="Visibility" TargetName="BdSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="borderSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="Background" Value="Collapsed" />
                            <Setter Property="BorderThickness" TargetName="borderSelected" Value="1,0,1,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="0,0,8,8" />
                            <Setter Property="Margin" TargetName="BdSelected" Value="-2,-6,-2,0" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="0,0,7,7" />
                            <Setter Property="Margin" TargetName="borderSelected" Value="0,5,0,0" />
                            <Setter Property="Margin" TargetName="Disabled" Value="-2,-2,-2,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="0,0,8,8" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="TabStripPlacement" Value="Left" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-2,-2,-1,-2" />
                            <Setter Property="Margin" TargetName="Content" Value="6,1,6,1" />
                            <Setter Property="Visibility" TargetName="Background" Value="Collapsed" />
                            <Setter Property="Visibility" TargetName="BdSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="borderSelected" Value="Visible" />
                            <Setter Property="BorderThickness" TargetName="borderSelected" Value="1,1,0,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="8,0,0,8" />
                            <Setter Property="Margin" TargetName="BdSelected" Value="0,-2,-6,-2" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="7,0,0,7" />
                            <Setter Property="Margin" TargetName="borderSelected" Value="0,0,6,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="8,0,0,8" />
                            <Setter Property="Margin" TargetName="Disabled" Value="0,-2,-2,-2" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="TabStripPlacement" Value="Right" />
                            </MultiTrigger.Conditions>
                            <Setter Property="Margin" Value="-1,-2,-2,-2" />
                            <Setter Property="Margin" TargetName="Content" Value="6,1,6,1" />
                            <Setter Property="Visibility" TargetName="Background" Value="Hidden" />
                            <Setter Property="Visibility" TargetName="BdSelected" Value="Visible" />
                            <Setter Property="Visibility" TargetName="borderSelected" Value="Visible" />
                            <Setter Property="BorderThickness" TargetName="borderSelected" Value="0,1,1,1" />
                            <Setter Property="CornerRadius" TargetName="BdSelected" Value="0,8,8,0" />
                            <Setter Property="Margin" TargetName="BdSelected" Value="-6,-2,0,-2" />
                            <Setter Property="Margin" TargetName="borderSelected" Value="6,0,0,0" />
                            <Setter Property="CornerRadius" TargetName="borderSelected" Value="0,7,7,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="0,8,8,0" />
                            <Setter Property="Margin" TargetName="Disabled" Value="-2,-2,0,-2" />
                            <Setter Property="Visibility" TargetName="Disabled" Value="Collapsed" />
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Visibility" TargetName="Disabled" Value="Visible" />
                            <Setter Property="Margin" TargetName="Disabled" Value="0,0,0,0" />
                            <Setter Property="CornerRadius" TargetName="Disabled" Value="6,6,0,0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsSelected" Value="False" />
    </Style>

    <!-- ComboBox -->
    <Style TargetType="{x:Type ComboBox}">
        <Style.Resources>
            <Geometry x:Key="DownArrowGeometry">M 0 0 L 3.5 4 L 7 0 Z</Geometry>
            <Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Focusable" Value="false" />
                <Setter Property="ClickMode" Value="Press" />
                <Setter Property="Background" Value="{DynamicResource SecondaryColor}" />
                <Setter Property="BorderBrush" Value="{DynamicResource TextBorderBrush}" />
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                            <Grid>
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualStateGroup.Transitions>
                                            <VisualTransition GeneratedDuration="00:00:00.2000000" />
                                            <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
                                            <VisualTransition From="Pressed" GeneratedDuration="00:00:00" />
                                        </VisualStateGroup.Transitions>
                                        <VisualState x:Name="Normal" />
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Shadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                    <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Pressed">
                                            <Storyboard>
                                                <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                    <SplineThicknessKeyFrame KeyTime="0" Value="2.5,2.5,0.5,0.5" />
                                                </ThicknessAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                    <VisualStateGroup x:Name="FocusStates">
                                        <VisualState x:Name="Focused">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Focus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Unfocused" />
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <Border Grid.RowSpan="1" CornerRadius="12,12,12,12" BorderThickness="1,1,1,1" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" x:Name="border" />
                                <Grid x:Name="Shadow">
                                    <Border Background="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource BottomShadowMask}" CornerRadius="12,12,12,12" />
                                    <Border CornerRadius="12,12,12,12" Background="{TemplateBinding BorderBrush}" OpacityMask="{DynamicResource HaloMask}" />
                                </Grid>
                                <Grid Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" HorizontalAlignment="Right" Grid.RowSpan="1">
                                    <Path Fill="{TemplateBinding Foreground}" HorizontalAlignment="Center" x:Name="Arrow" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}" />
                                </Grid>
                                <Border Grid.RowSpan="1" Margin="-3,-3,-3,-3" CornerRadius="13,13,13,13" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource SecondaryBrush}" Visibility="Collapsed" OpacityMask="{DynamicResource FocusMask}" x:Name="Focus" />
                                <Border CornerRadius="12,12,12,12" Visibility="Collapsed" x:Name="Disabled">
                                    <Border.Background>
                                        <SolidColorBrush Color="{DynamicResource DisabledColor}" />
                                    </Border.Background>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsChecked" Value="true" />
                                <Trigger Property="IsFocused" Value="True">
                                    <Setter Property="Visibility" TargetName="Focus" Value="Visible" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Fill" TargetName="Arrow" Value="#AFAFAF" />
                                    <Setter Property="Visibility" TargetName="Disabled" Value="Visible" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
                <ControlTemplate.Resources>
                    <Style x:Name="EditComboTextBox" TargetType="{x:Type TextBox}">
                        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                        <Setter Property="Background" Value="{DynamicResource SecondaryColor}" />
                        <Setter Property="BorderBrush" Value="{DynamicResource TextBorderBrush}" />
                        <Setter Property="BorderThickness" Value="1,1.5,0.5,0.5" />
                        <Setter Property="Padding" Value="1" />
                        <Setter Property="AllowDrop" Value="true" />
                        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                        <Setter Property="MinWidth" Value="0" />
                        <Setter Property="MinHeight" Value="0" />
                        <!--<Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type TextBox}">
                                <Grid>
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled">
                                                <Storyboard>
                                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="PART_ContentHost" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                    <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="White" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                        <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                                    </ThicknessAnimationUsingKeyFrames>
                                                    <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="ReadOnly" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Border Background="{TemplateBinding Background}" x:Name="White" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" BorderThickness="1,1.5,0.5,0.5" />
                                    <Grid x:Name="InnerShadow">
                                        <Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" OpacityMask="{DynamicResource BoxBottomShadowMask}" />
                                        <Border x:Name="Halo" Background="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" OpacityMask="{DynamicResource HaloMask}" />
                                    </Grid>
                                    <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    <Border CornerRadius="7,7,7,7" Margin="-3,-3,-3,-3" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,1" OpacityMask="{DynamicResource FocusMask}" Visibility="Collapsed" x:Name="border" />
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsEnabled" Value="False">
                                        <Setter Property="BorderThickness" TargetName="White" Value="0.5,0.5,0.5,0.5" />
                                        <Setter Property="Opacity" TargetName="InnerShadow" Value="0.65" />
                                        <Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.35" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter> -->
                    </Style>
                </ControlTemplate.Resources>
                <Grid x:Name="Placement" SnapsToDevicePixels="true">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="1">
                        <Border MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=Placement}" x:Name="Shdw">
                            <Border x:Name="DropDownBorder" Background="{DynamicResource SecondaryColor}" BorderBrush="{DynamicResource TextBorderBrush}" BorderThickness="1" CornerRadius="4,4,4,4">
                                <ScrollViewer>
                                    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                                </ScrollViewer>
                            </Border>
                        </Border>
                    </Popup>
                    <Border CornerRadius="4,4,4,4" x:Name="Border">
                        <Grid>
                            <ToggleButton Style="{DynamicResource ComboBoxReadonlyToggleButton}" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Stretch" />
                            <TextBox x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsReadOnly="{Binding Path=IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="6,2,21,2" Background="{x:Null}" Style="{DynamicResource EditComboTextBox}" />
                        </Grid>
                    </Border>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsKeyboardFocusWithin" Value="true">
                        <Setter Property="Foreground" Value="Black" />
                    </Trigger>
                    <Trigger Property="IsDropDownOpen" Value="true" />
                    <Trigger Property="HasItems" Value="false">
                        <Setter Property="Height" TargetName="DropDownBorder" Value="95" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" Value="#FFF4F4F4" />
                    </Trigger>
                    <Trigger Property="IsGrouping" Value="true">
                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Style.Resources>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource TextBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Padding" Value="4,3" />
        <Setter Property="Background" Value="{DynamicResource SecondaryColor}" />
        <!--<Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type ComboBox}">
                <Grid x:Name="MainGrid" SnapsToDevicePixels="true">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" Width="0" />
                    </Grid.ColumnDefinitions>
                    <Popup Margin="1" x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
                        <Border x:Name="DropDownBorder" Background="{DynamicResource SecondaryColor}" BorderBrush="{DynamicResource TextBorderBrush}" BorderThickness="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding Path=ActualWidth, ElementName=MainGrid}" CornerRadius="4,4,4,4">
                            <ScrollViewer CanContentScroll="true">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                            </ScrollViewer>
                        </Border>
                    </Popup>
                    <ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" Grid.ColumnSpan="2" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" />
                    <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsHitTestVisible="false" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" />
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="HasItems" Value="false">
                        <Setter Property="Height" TargetName="DropDownBorder" Value="95" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Background" Value="#FFF4F4F4" />
                    </Trigger>
                    <Trigger Property="IsGrouping" Value="true">
                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>-->
        <Style.Triggers>
            <Trigger Property="IsEditable" Value="true">
                <Setter Property="IsTabStop" Value="false" />
                <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- ComboBoxItem -->
    <Style TargetType="{x:Type ComboBoxItem}">
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Padding" Value="3,0,3,0" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="{DynamicResource TextBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ComboBoxItem}">
                    <Grid>
                        <Rectangle Stroke="{DynamicResource SecondaryBrush}" RadiusX="3" RadiusY="3" x:Name="Hover" Opacity="0">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle RadiusX="3" RadiusY="3" x:Name="Selected" Opacity="0" Stroke="{DynamicResource SecondaryBrush}">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Border x:Name="Bd" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}">
                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="contentPresenter" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Opacity" TargetName="Hover" Value="0.35" />
                        </Trigger>
                        <Trigger Property="IsHighlighted" Value="true">
                            <Setter Property="Opacity" TargetName="Selected" Value="0.75" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Opacity" TargetName="Bd" Value="1" />
                            <Setter Property="Opacity" TargetName="contentPresenter" Value="1" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
    </Style>

    <!-- Menu -->
    <Style TargetType="{x:Type Menu}">
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
        <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}" />
        <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}" />
        <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}" />
        <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Menu}">
                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="4,4,4,4" BorderThickness="{TemplateBinding BorderThickness}" Padding="1,1,1,1">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid x:Name="Shadow">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="6" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="6" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="6" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="6" />
                                </Grid.ColumnDefinitions>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.655,0.644">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.489" ScaleY="3.489" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="-0.063" Y="-0.025" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-1.025">
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            <GradientStop Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,2.5,0,0" Grid.Column="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.283,0.71">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.805" ScaleY="2.805" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0.144" Y="-0.125" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="1,.5" StartPoint="-0.972,0.5">
                                            <GradientStop Color="#00000000" Offset="1" />
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" OpacityMask="#00000000" Grid.Column="1" Grid.Row="1" />
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0,0.5" StartPoint="2.01,0.5">
                                            <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            <GradientStop Color="#00FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,0,2.5" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.646,0.361">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.438" ScaleY="3.438" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="-0.072" Y="0.072" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Margin="0,0,0,0" Grid.Column="1" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,2.065" StartPoint="0.5,0">
                                            <GradientStop Color="#00000000" Offset="0" />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,2.5,0" Grid.Column="2" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush GradientOrigin="0.287,0.495">
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="4.282" ScaleY="3.792" />
                                                    <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                    <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                    <TranslateTransform X="0.495" Y="-0.463" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#A5FFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                            </Grid>
                            <Border SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" Grid.RowSpan="1">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="4,0,4,0" />
                            </Border>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- MenuItem -->
    <Style TargetType="{x:Type MenuItem}">
        <Style.Resources>
            <Geometry x:Key="Checkmark">M 0,5.1 L 1.7,5.2 L 3.4,7.1 L 8,0.4 L 9.2,0 L 3.3,10.8 Z</Geometry>
            <Style x:Key="MenuScrollButton" BasedOn="{x:Null}" TargetType="{x:Type RepeatButton}">
                <Setter Property="ClickMode" Value="Hover" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="MinHeight" Value="0" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type RepeatButton}">
                            <DockPanel SnapsToDevicePixels="true" Background="Transparent">
                                <Rectangle Fill="Transparent" x:Name="R1" Width="1" DockPanel.Dock="Right" />
                                <Rectangle Fill="Transparent" x:Name="B1" Height="1" DockPanel.Dock="Bottom" />
                                <Rectangle Fill="Transparent" x:Name="L1" Width="1" DockPanel.Dock="Left" />
                                <Rectangle Fill="Transparent" x:Name="T1" Height="1" DockPanel.Dock="Top" />
                                <ContentPresenter HorizontalAlignment="Center" Margin="2,2,2,2" x:Name="ContentContainer" VerticalAlignment="Center" />
                            </DockPanel>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Margin" TargetName="ContentContainer" Value="3,3,1,1" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
            <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter" />
            <Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
            <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
            <Style x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}" BasedOn="{x:Null}" TargetType="{x:Type ScrollViewer}">
                <Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
                <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollViewer}">
                            <Grid SnapsToDevicePixels="true">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                                <Border Grid.Row="1">
                                    <ScrollContentPresenter Margin="{TemplateBinding Padding}" />
                                </Border>
                                <RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                    <RepeatButton.Visibility>
                                        <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">
                                            <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                                        </MultiBinding>
                                    </RepeatButton.Visibility>
                                    <Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}" />
                                </RepeatButton>
                                <RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Grid.Row="2" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
                                    <RepeatButton.Visibility>
                                        <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">
                                            <Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                                            <Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
                                        </MultiBinding>
                                    </RepeatButton.Visibility>
                                    <Path Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}" />
                                </RepeatButton>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">
                <Grid>
                    <Grid x:Name="Shadow">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="6" />
                            <RowDefinition Height="*" />
                            <RowDefinition Height="6" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="6" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="6" />
                        </Grid.ColumnDefinitions>
                        <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                            <Border.OpacityMask>
                                <RadialGradientBrush GradientOrigin="0.655,0.644">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.489" ScaleY="3.489" />
                                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="-0.063" Y="-0.025" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop />
                                    <GradientStop Color="#A5FFFFFF" Offset="1" />
                                </RadialGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-1.025">
                                    <GradientStop Color="#A5FFFFFF" Offset="0" />
                                    <GradientStop Offset="1" />
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,2.5,0,0" Grid.Column="2">
                            <Border.OpacityMask>
                                <RadialGradientBrush GradientOrigin="0.283,0.71">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.805" ScaleY="2.805" />
                                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="0.144" Y="-0.125" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop />
                                    <GradientStop Color="#A5FFFFFF" Offset="1" />
                                </RadialGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="1,.5" StartPoint="-0.972,0.5">
                                    <GradientStop Color="#00000000" Offset="1" />
                                    <GradientStop Color="#A5FFFFFF" Offset="0" />
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" OpacityMask="#00000000" Grid.Column="1" Grid.Row="1" />
                        <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="0,0.5" StartPoint="2.01,0.5">
                                    <GradientStop Color="#A5FFFFFF" Offset="0" />
                                    <GradientStop Color="#00FFFFFF" Offset="1" />
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,0,2.5" Grid.Row="2">
                            <Border.OpacityMask>
                                <RadialGradientBrush GradientOrigin="0.646,0.361">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.438" ScaleY="3.438" />
                                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="-0.072" Y="0.072" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop />
                                    <GradientStop Color="#A5FFFFFF" Offset="1" />
                                </RadialGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" Margin="0,0,0,0" Grid.Column="1" Grid.Row="2">
                            <Border.OpacityMask>
                                <LinearGradientBrush EndPoint="0.5,2.065" StartPoint="0.5,0">
                                    <GradientStop Color="#00000000" Offset="0" />
                                    <GradientStop Color="#A5FFFFFF" Offset="1" />
                                </LinearGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                        <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,2.5,0" Grid.Column="2" Grid.Row="2">
                            <Border.OpacityMask>
                                <RadialGradientBrush GradientOrigin="0.287,0.495">
                                    <RadialGradientBrush.RelativeTransform>
                                        <TransformGroup>
                                            <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="4.282" ScaleY="3.792" />
                                            <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                            <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                            <TranslateTransform X="0.495" Y="-0.463" />
                                        </TransformGroup>
                                    </RadialGradientBrush.RelativeTransform>
                                    <GradientStop />
                                    <GradientStop Color="#A5FFFFFF" Offset="1" />
                                </RadialGradientBrush>
                            </Border.OpacityMask>
                        </Border>
                    </Grid>
                    <Border Background="{DynamicResource PrimaryBrush}" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1" CornerRadius="4,4,4,4" Margin="1,1,1,1">
                        <Grid>
                            <ContentPresenter Margin="1,0" Grid.ColumnSpan="2" />
                        </Grid>
                    </Border>
                </Grid>
            </ControlTemplate>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid x:Name="SelectHoverGrid" Opacity="0">
                        <Border x:Name="Background" CornerRadius="12" BorderThickness="0.5,0.5,1.5,1.5" HorizontalAlignment="Stretch" Visibility="Visible" BorderBrush="{DynamicResource SecondaryBrush}">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <Grid x:Name="InnerShadow" HorizontalAlignment="Stretch">
                            <Border x:Name="BottomShadow" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}">
                                <Border.Background>
                                    <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                </Border.Background>
                            </Border>
                            <Border x:Name="Halo" CornerRadius="12" OpacityMask="{StaticResource HaloMask}">
                                <Border.Background>
                                    <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                </Border.Background>
                            </Border>
                        </Grid>
                    </Grid>
                    <Grid Grid.RowSpan="1" Margin="4,0,4,0" VerticalAlignment="Center" x:Name="grid">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition SharedSizeGroup="MenuItemIconColumnGroup" MinWidth="24" Width="Auto" />
                            <ColumnDefinition Width="4" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="37" />
                            <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" />
                            <ColumnDefinition Width="17" />
                        </Grid.ColumnDefinitions>
                        <ContentPresenter Margin="1" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon" />
                        <Border Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Visibility="Hidden" Background="{DynamicResource PrimaryBrush}" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1" CornerRadius="3">
                            <Path Fill="{DynamicResource TextBrush}" FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Data="{StaticResource Checkmark}" />
                        </Border>
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <TextBlock Margin="{TemplateBinding Padding}" Grid.Column="4" Foreground="{DynamicResource TextBrush}" Text="{TemplateBinding InputGestureText}" />
                    </Grid>
                    <Border x:Name="focused" BorderBrush="{DynamicResource SecondaryBrush}" CornerRadius="12,12,12,12" BorderThickness="1,1,1,1" Visibility="Collapsed" />
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsFocused" Value="True">
                        <Setter Property="Visibility" TargetName="focused" Value="Visible" />
                    </Trigger>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Opacity" TargetName="SelectHoverGrid" Value="1" />
                        <Setter Property="BorderBrush" TargetName="Background" Value="#FFCCCCCC" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A" />
                        <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9" />
                        <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6" />
                        <Setter Property="Fill" TargetName="Glyph" Value="#848589" />
                        <Setter Property="Opacity" TargetName="grid" Value="0.65" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true">
                    <Rectangle RadiusX="3" RadiusY="3" x:Name="OuterBorder" />
                    <Rectangle Stroke="{TemplateBinding BorderBrush}" StrokeThickness="1" RadiusX="4" RadiusY="4" Margin="1" x:Name="Bg" Opacity="0">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1.47" StartPoint="0.5,0">
                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <DockPanel>
                        <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon" />
                        <Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}" />
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" />
                    </DockPanel>
                    <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="1" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-1" Focusable="false">
                        <Border x:Name="Shdw" CornerRadius="4,4,4,4">
                            <ContentControl x:Name="SubMenuBorder" IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">
                                <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
                                    <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" />
                                </ScrollViewer>
                            </ContentControl>
                        </Border>
                    </Popup>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                        <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None" />
                    </Trigger>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Opacity" TargetName="Bg" Value="0.65" />
                    </Trigger>
                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="IsMouseOver" Value="True" />
                            <Condition Property="IsChecked" Value="True" />
                        </MultiTrigger.Conditions>
                        <Setter Property="Opacity" TargetName="Bg" Value="0.65" />
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                    </MultiTrigger>
                    <Trigger Property="IsKeyboardFocused" Value="true">
                        <Setter Property="Stroke" TargetName="Bg" Value="#E0717070" />
                    </Trigger>
                    <Trigger Property="IsSubmenuOpen" Value="true">
                        <Setter Property="Opacity" TargetName="Bg" Value="0.65" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A" />
                        <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true">
                    <Rectangle RadiusX="4" RadiusY="4" x:Name="OuterBorder" />
                    <Rectangle StrokeThickness="1" RadiusX="3" RadiusY="3" Margin="1" x:Name="Bg" />
                    <Rectangle Margin="2" x:Name="InnerBorder" />
                    <DockPanel>
                        <ContentPresenter Margin="4,0,6,0" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon" />
                        <Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" Margin="7,0,0,0" x:Name="GlyphPanel" VerticalAlignment="Center" Visibility="Collapsed" Data="{StaticResource Checkmark}" />
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" />
                    </DockPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <MultiTrigger>
                        <MultiTrigger.Conditions>
                            <Condition Property="IsChecked" Value="True" />
                            <Condition Property="IsHighlighted" Value="True" />
                        </MultiTrigger.Conditions>
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                        <Setter Property="Fill" TargetName="Bg">
                            <Setter.Value>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Opacity" TargetName="Bg" Value="0.65" />
                    </MultiTrigger>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="RadiusX" TargetName="Bg" Value="4" />
                        <Setter Property="RadiusY" TargetName="Bg" Value="4" />
                        <Setter Property="Fill" TargetName="Bg">
                            <Setter.Value>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Opacity" TargetName="Bg" Value="0.65" />
                    </Trigger>
                    <Trigger Property="IsKeyboardFocused" Value="true">
                        <Setter Property="Stroke" TargetName="Bg" Value="#E0717070" />
                        <Setter Property="Stroke" TargetName="InnerBorder" Value="#50747272" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A" />
                        <Setter Property="Fill" TargetName="GlyphPanel" Value="#848589" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
                <Grid SnapsToDevicePixels="true">
                    <Rectangle StrokeThickness="1" RadiusX="3" RadiusY="3" x:Name="Bg" Opacity="0" Margin="1,1,1,1" Stroke="{TemplateBinding BorderBrush}">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1.758" StartPoint="0.5,0">
                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle StrokeThickness="1" RadiusX="3" RadiusY="3" Margin="1" x:Name="InnerBorder" Opacity="0" Stroke="{TemplateBinding BorderBrush}">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.5,1.758" StartPoint="0.5,0">
                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Grid x:Name="SelectHoverGrid" Opacity="0">
                        <Border x:Name="Background" CornerRadius="12" BorderThickness="0.5,0.5,1.5,1.5" HorizontalAlignment="Stretch" Visibility="Visible" BorderBrush="{DynamicResource SecondaryBrush}">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                    <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                        </Border>
                        <Grid x:Name="InnerShadow" HorizontalAlignment="Stretch">
                            <Border x:Name="BottomShadow" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}">
                                <Border.Background>
                                    <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                </Border.Background>
                            </Border>
                            <Border x:Name="Halo" CornerRadius="12" OpacityMask="{StaticResource HaloMask}">
                                <Border.Background>
                                    <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                </Border.Background>
                            </Border>
                        </Grid>
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition SharedSizeGroup="MenuItemIconColumnGroup" MinWidth="24" Width="Auto" />
                            <ColumnDefinition Width="4" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="37" />
                            <ColumnDefinition SharedSizeGroup="MenuItemIGTColumnGroup" Width="Auto" />
                            <ColumnDefinition Width="17" />
                        </Grid.ColumnDefinitions>
                        <ContentPresenter Margin="1" x:Name="Icon" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Icon" />
                        <Border Margin="1" x:Name="GlyphPanel" Width="22" Height="22" Visibility="Hidden" Background="{DynamicResource PrimaryBrush}" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1" CornerRadius="3">
                            <Path Fill="{TemplateBinding Foreground}" FlowDirection="LeftToRight" x:Name="Glyph" Width="9" Height="11" Data="{StaticResource Checkmark}" />
                        </Border>
                        <ContentPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.Column="2" ContentSource="Header" RecognizesAccessKey="True" />
                        <TextBlock Margin="{TemplateBinding Padding}" Visibility="Collapsed" Grid.Column="4" Text="{TemplateBinding InputGestureText}" Foreground="{TemplateBinding Foreground}" />
                        <Path Fill="{TemplateBinding Foreground}" Margin="4,0,0,0" VerticalAlignment="Center" Grid.Column="5" Data="{StaticResource RightArrow}" />
                    </Grid>
                    <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="-2" IsOpen="{Binding Path=IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-3" Focusable="false">
                        <Border x:Name="Shdw" Background="{x:Null}" CornerRadius="4,4,4,4">
                            <ContentControl x:Name="SubMenuBorder" IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">
                                <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">
                                    <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" />
                                </ScrollViewer>
                            </ContentControl>
                        </Border>
                    </Popup>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                        <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None" />
                    </Trigger>
                    <Trigger Property="Icon" Value="{x:Null}">
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsChecked" Value="true">
                        <Setter Property="Visibility" TargetName="GlyphPanel" Value="Visible" />
                        <Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
                    </Trigger>
                    <Trigger Property="IsHighlighted" Value="true">
                        <Setter Property="Opacity" TargetName="SelectHoverGrid" Value="1" />
                    </Trigger>
                    <Trigger Property="IsEnabled" Value="false">
                        <Setter Property="Foreground" Value="#FF9A9A9A" />
                        <Setter Property="Background" TargetName="GlyphPanel" Value="#EEE9E9" />
                        <Setter Property="BorderBrush" TargetName="GlyphPanel" Value="#DBD6D6" />
                        <Setter Property="Fill" TargetName="Glyph" Value="#848589" />
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Style.Resources>
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Padding" Value="7,2,8,3" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Padding" Value="7,2,8,3" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="Padding" Value="2,3,2,3" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
                <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Padding" Value="2,3,2,3" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!-- ToolBar -->
    <Style TargetType="{x:Type ToolBar}">
        <Style.Resources>
            <Style x:Key="ToolBarVerticalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
                <Setter Property="MinHeight" Value="0" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                            <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,0,3,3" BorderThickness="1,1,1,1" BorderBrush="{DynamicResource SecondaryBrush}">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0,1.407" StartPoint="0,0">
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Canvas HorizontalAlignment="Right" Margin="2,7,2,2" VerticalAlignment="Bottom" Width="7" Height="6" SnapsToDevicePixels="true">
                                    <Path Stroke="White" Data="M 1.5 1 L 1.5 6" x:Name="path" />
                                    <Path Stroke="{TemplateBinding Foreground}" Data="M 0.5 0 L 0.5 5" x:Name="path1" />
                                    <Path Fill="White" Data="M 3.5 0.5 L 7 3.5 L 4 6.5 Z" x:Name="path2" />
                                    <Path Fill="{TemplateBinding Foreground}" Data="M 3 -0.5 L 6 2.5 L 3 5.5 Z" x:Name="path3" />
                                </Canvas>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="Bd">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1.407" StartPoint="0,0">
                                                <GradientStop Color="#FFCCCCCC" Offset="0" />
                                                <GradientStop Color="#FFFFFFFF" Offset="0.522" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{DynamicResource TextBrush}" />
                                    <Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="Bd">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1.407" StartPoint="0,0">
                                                <GradientStop Color="{DynamicResource DisabledColor}" Offset="0.671" />
                                                <GradientStop Color="{DynamicResource DisabledColor}" Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Opacity" TargetName="path" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path1" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path2" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path3" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ToolBarHorizontalOverflowButtonStyle" TargetType="{x:Type ToggleButton}">
                <Setter Property="MinHeight" Value="0" />
                <Setter Property="MinWidth" Value="0" />
                <Setter Property="Background" Value="#00FFFFFF" />
                <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
                <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ToggleButton}">
                            <Border x:Name="Bd" SnapsToDevicePixels="true" CornerRadius="0,3,3,0" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1,1,1,1">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0,1.307" StartPoint="0,-0.524">
                                        <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                        <GradientStop Color="{DynamicResource PrimaryColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Canvas HorizontalAlignment="Right" Margin="7,2,2,2" VerticalAlignment="Bottom" Width="6" Height="7" SnapsToDevicePixels="true">
                                    <Path Stroke="White" Data="M 1 1.5 L 6 1.5" x:Name="path2" />
                                    <Path Stroke="{TemplateBinding Foreground}" Data="M 0 0.5 L 5 0.5" x:Name="path" />
                                    <Path Fill="White" Data="M 0.5 4 L 6.5 4 L 3.5 7 Z" x:Name="path3" />
                                    <Path Fill="{TemplateBinding Foreground}" Data="M -0.5 3 L 5.5 3 L 2.5 6 Z" x:Name="path1" />
                                </Canvas>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="Bd">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1.307" StartPoint="0,-0.524">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.643" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Background" TargetName="Bd">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0,1.307" StartPoint="0,0">
                                                <GradientStop Color="{DynamicResource DisabledColor}" Offset="0.74" />
                                                <GradientStop Color="{DynamicResource DisabledColor}" Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="Opacity" TargetName="path" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path1" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path2" Value="0.5" />
                                    <Setter Property="Opacity" TargetName="path3" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ToolBarThumbStyle" TargetType="{x:Type Thumb}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Thumb}">
                            <Border SnapsToDevicePixels="True" Background="Transparent" Padding="{TemplateBinding Padding}">
                                <Rectangle>
                                    <Rectangle.Fill>
                                        <DrawingBrush TileMode="Tile" Viewbox="0,0,4,4" ViewboxUnits="Absolute" Viewport="0,0,4,4" ViewportUnits="Absolute">
                                            <DrawingBrush.Drawing>
                                                <DrawingGroup>
                                                    <GeometryDrawing Brush="#FFCCCCCC" Geometry="M1,1L1,3 3,3 3,1z" />
                                                    <GeometryDrawing Brush="#FF333333" Geometry="M0,0L0,2 2,2 2,0z" />
                                                </DrawingGroup>
                                            </DrawingBrush.Drawing>
                                        </DrawingBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Cursor" Value="SizeAll" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="ToolBarButtonBaseStyle" TargetType="{x:Type ButtonBase}">
                <Setter Property="SnapsToDevicePixels" Value="true" />
                <Setter Property="OverridesDefaultStyle" Value="true" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ButtonBase}">
                            <Border x:Name="Border" BorderThickness="1" Background="Transparent" BorderBrush="Transparent">
                                <ContentPresenter Margin="10,5" HorizontalAlignment="Center" x:Name="contentPresenter" />
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsKeyboardFocused" Value="true">
                                    <Setter Property="Background" TargetName="Border">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource SecondaryBrush}" />
                                </Trigger>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="Border">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource SecondaryBrush}" />
                                </Trigger>
                                <Trigger Property="IsPressed" Value="true">
                                    <Setter Property="Background" TargetName="Border">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.161" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.875" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderBrush" TargetName="Border">
                                        <Setter.Value>
                                            <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="ToggleButton.IsChecked" Value="true">
                                    <Setter Property="Background" TargetName="Border">
                                        <Setter.Value>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="0" />
                                                <GradientStop Color="{DynamicResource SecondaryColor}" Offset="1" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.129" />
                                                <GradientStop Color="{DynamicResource PrimaryColor}" Offset="0.884" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                    <Setter Property="BorderBrush" TargetName="Border">
                                        <Setter.Value>
                                            <SolidColorBrush Color="{DynamicResource SecondaryColor}" />
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="false">
                                    <Setter Property="Opacity" TargetName="contentPresenter" Value="0.5" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
            <Style x:Key="{x:Static ToolBar.ButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type Button}" />
        </Style.Resources>
        <Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBrush}" />
        <Setter Property="BorderThickness" Value="1,1,1,1" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToolBar}">
                    <Grid Margin="3,1,1,1" x:Name="Grid" SnapsToDevicePixels="true">
                        <Grid HorizontalAlignment="Right" x:Name="OverflowGrid">
                            <ToggleButton FocusVisualStyle="{x:Null}" x:Name="OverflowButton" Style="{StaticResource ToolBarHorizontalOverflowButtonStyle}" IsEnabled="{TemplateBinding HasOverflowItems}" IsChecked="{Binding Path=IsOverflowOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" />
                            <Popup x:Name="OverflowPopup" AllowsTransparency="true" IsOpen="{Binding Path=IsOverflowOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" StaysOpen="false" Focusable="false">
                                <Border x:Name="Shdw">
                                    <Border Background="{DynamicResource PrimaryBrush}" BorderBrush="{DynamicResource SecondaryBrush}" BorderThickness="1" CornerRadius="4,4,4,4">
                                        <ToolBarOverflowPanel FocusVisualStyle="{x:Null}" Margin="2" x:Name="PART_ToolBarOverflowPanel" Focusable="true" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" WrapWidth="200" />
                                    </Border>
                                </Border>
                            </Popup>
                        </Grid>
                        <Border Margin="0,0,11,0" x:Name="MainPanelBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,3,3" Padding="{TemplateBinding Padding}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="0.485*" />
                                    <RowDefinition Height="0.515*" />
                                </Grid.RowDefinitions>
                                <Grid x:Name="Shadow" Grid.RowSpan="2">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="6" />
                                        <RowDefinition Height="*" />
                                        <RowDefinition Height="6" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="6" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="6" />
                                    </Grid.ColumnDefinitions>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.655,0.644">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.489" ScaleY="3.489" />
                                                        <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                        <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                        <TranslateTransform X="-0.063" Y="-0.025" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,-1.025">
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                                <GradientStop Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,2.5,0,0" Grid.Column="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.283,0.71">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2.805" ScaleY="2.805" />
                                                        <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                        <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                        <TranslateTransform X="0.144" Y="-0.125" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="1,.5" StartPoint="-0.972,0.5">
                                                <GradientStop Color="#00000000" Offset="1" />
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" OpacityMask="#00000000" Grid.Column="1" Grid.Row="1" />
                                    <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0,0.5" StartPoint="2.01,0.5">
                                                <GradientStop Color="#A5FFFFFF" Offset="0" />
                                                <GradientStop Color="#00FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,0,2.5" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.646,0.361">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="3.438" ScaleY="3.438" />
                                                        <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                        <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                        <TranslateTransform X="-0.072" Y="0.072" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" Margin="0,0,0,0" Grid.Column="1" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <LinearGradientBrush EndPoint="0.5,2.065" StartPoint="0.5,0">
                                                <GradientStop Color="#00000000" Offset="0" />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </LinearGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                    <Border Background="{StaticResource SecondaryBrush}" CornerRadius="0,0,2.5,0" Grid.Column="2" Grid.Row="2">
                                        <Border.OpacityMask>
                                            <RadialGradientBrush GradientOrigin="0.287,0.495">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="4.282" ScaleY="3.792" />
                                                        <SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5" />
                                                        <RotateTransform Angle="0" CenterX="0.5" CenterY="0.5" />
                                                        <TranslateTransform X="0.495" Y="-0.463" />
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop />
                                                <GradientStop Color="#A5FFFFFF" Offset="1" />
                                            </RadialGradientBrush>
                                        </Border.OpacityMask>
                                    </Border>
                                </Grid>
                                <DockPanel KeyboardNavigation.TabIndex="1" KeyboardNavigation.TabNavigation="Local" Grid.RowSpan="2">
                                    <Thumb Margin="-3,-1,0,0" x:Name="ToolBarThumb" Style="{StaticResource ToolBarThumbStyle}" Width="10" Padding="6,5,1,6" Background="{DynamicResource SecondaryBrush}" />
                                    <ContentPresenter HorizontalAlignment="Center" Margin="4,0,4,0" x:Name="ToolBarHeader" VerticalAlignment="Center" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" />
                                    <ToolBarPanel Margin="0,1,2,2" x:Name="PART_ToolBarPanel" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" IsItemsHost="true" />
                                </DockPanel>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsOverflowOpen" Value="true">
                            <Setter Property="IsEnabled" TargetName="ToolBarThumb" Value="false" />
                        </Trigger>
                        <Trigger Property="Header" Value="{x:Null}">
                            <Setter Property="Visibility" TargetName="ToolBarHeader" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="ToolBarTray.IsLocked" Value="true">
                            <Setter Property="Visibility" TargetName="ToolBarThumb" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="HasDropShadow" SourceName="OverflowPopup" Value="true">
                            <Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5" />
                            <Setter Property="SnapsToDevicePixels" TargetName="Shdw" Value="true" />
                        </Trigger>
                        <Trigger Property="Orientation" Value="Vertical">
                            <Setter Property="Margin" TargetName="Grid" Value="1,3,1,1" />
                            <Setter Property="Style" TargetName="OverflowButton" Value="{StaticResource ToolBarVerticalOverflowButtonStyle}" />
                            <Setter Property="Height" TargetName="ToolBarThumb" Value="10" />
                            <Setter Property="Width" TargetName="ToolBarThumb" Value="Auto" />
                            <Setter Property="Margin" TargetName="ToolBarThumb" Value="-1,-3,0,0" />
                            <Setter Property="Padding" TargetName="ToolBarThumb" Value="5,6,6,1" />
                            <Setter Property="Margin" TargetName="ToolBarHeader" Value="0,0,0,4" />
                            <Setter Property="Margin" TargetName="PART_ToolBarPanel" Value="1,0,2,2" />
                            <Setter Property="DockPanel.Dock" TargetName="ToolBarThumb" Value="Top" />
                            <Setter Property="DockPanel.Dock" TargetName="ToolBarHeader" Value="Top" />
                            <Setter Property="HorizontalAlignment" TargetName="OverflowGrid" Value="Stretch" />
                            <Setter Property="VerticalAlignment" TargetName="OverflowGrid" Value="Bottom" />
                            <Setter Property="Placement" TargetName="OverflowPopup" Value="Right" />
                            <Setter Property="Margin" TargetName="MainPanelBorder" Value="0,0,0,11" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--ToolTip-->
    <SolidColorBrush x:Key="ToolTipText" Color="#000000" />
    <SolidColorBrush x:Key="ToolTipBorder" Color="#ff0000" />

    <Style TargetType="ToolTip">
        <Setter Property="Foreground" Value="{StaticResource ToolTipText}" />
        <Setter Property="Background" Value="{StaticResource SecondaryBrush}" />
        <Setter Property="Padding" Value="5,0" />
        <Setter Property="BorderBrush" Value="{StaticResource ToolTipBorder}" />
        <Setter Property="Content" Value="ToolTip" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToolTip">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0.5,0.5,1,1" />
                        <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RenderTransformOrigin="0.5,0.5" Content="{TemplateBinding Content}" Margin="10,5" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- ProgressBar -->
    <Color x:Key="ProgressPrimaryColor">#0000ff</Color>
    <Color x:Key="ProgressSecondaryColor">#800080</Color>
    <Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
        <Setter Property="Foreground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1.75" StartPoint="0.5,-.5">
                    <GradientStop Color="{StaticResource ProgressPrimaryColor}" Offset=".3" />
                    <GradientStop Color="{StaticResource ProgressSecondaryColor}" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush StartPoint="0.5,-.25" EndPoint="0.5,1.25">
                    <GradientStop Color="{StaticResource SecondaryColor}" Offset="0" />
                    <GradientStop Color="{StaticResource PrimaryColor}" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{StaticResource SecondaryBrush}" />
        <Setter Property="BorderThickness" Value=".5,.5,1.5,1.5" />
        <Setter Property="Maximum" Value="100" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <Grid x:Name="Root" SnapsToDevicePixels="True">
                        <Border x:Name="PART_Track" Background="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4,4,4,4" />
                        <Grid x:Name="ProgressBarRootGrid">
                            <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
                                <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="IndeterminateSolidFill" Opacity="1" RenderTransformOrigin="0.5,0.5" RadiusX="4" RadiusY="4" Fill="{TemplateBinding Foreground}" Stroke="#FF448DCA" StrokeThickness="0" />
                                <Rectangle Margin="{TemplateBinding BorderThickness}" x:Name="IndeterminateGradientFill" Opacity="0.7" RadiusX="4" RadiusY="4" StrokeThickness="1">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush MappingMode="Absolute" SpreadMethod="Repeat" EndPoint="0,1" StartPoint="20,1">
                                            <LinearGradientBrush.Transform>
                                                <TransformGroup>
                                                    <TranslateTransform X="0" />
                                                    <SkewTransform AngleX="-30" />
                                                </TransformGroup>
                                            </LinearGradientBrush.Transform>
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                            <GradientStop Color="#00FFFFFF" Offset=".25" />
                                            <GradientStop Color="#FFFFFFFF" Offset="0.85" />
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                            </Grid>
                            <Grid x:Name="DeterminateRoot">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                <Border Background="{TemplateBinding Background}" CornerRadius="0,4,4,0" Grid.Column="1" Margin="0,1,1,1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="20,0" StartPoint="0,0" MappingMode="Absolute">
                                            <GradientStop Color="#00FFFFFF" Offset="0" />
                                            <GradientStop Color="#59FFFFFF" Offset="0.25" />
                                            <GradientStop Color="#A5000000" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border x:Name="PART_Indicator" CornerRadius="4,4,4,4" Background="{TemplateBinding Foreground}" Margin="1,1,1,1" />
                            </Grid>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsIndeterminate" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard RepeatBehavior="Forever">
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.Transform).(TransformGroup.Children)[0].X">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                                            <SplineDoubleKeyFrame KeyTime="00:00:.5" Value="20" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Setter Property="Visibility" Value="Visible" TargetName="IndeterminateRoot" />
                            <Setter Property="Visibility" Value="Collapsed" TargetName="DeterminateRoot" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Treeview -->
    <Style x:Key="{x:Type TreeView}" TargetType="{x:Type TreeView}">
        <Setter Property="Background" Value="{StaticResource PrimaryBrush}" />
        <Setter Property="Foreground" Value="{StaticResource TextBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="BorderThickness" Value="1.5,1.5,.75,.75" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1.5" StartPoint="0.5,0">
                    <GradientStop Color="{StaticResource SecondaryColor}" />
                    <GradientStop Color="{StaticResource PrimaryColor}" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeView}">
                    <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" CornerRadius="4">
                        <Grid>
                            <Grid x:Name="InnerShadow" Opacity="0.25" Margin="-1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="6" />
                                    <ColumnDefinition />
                                    <ColumnDefinition Width="6" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="6" />
                                    <RowDefinition />
                                    <RowDefinition Height="6" />
                                </Grid.RowDefinitions>
                                <Border Background="{StaticResource SecondaryBrush}" CornerRadius="2.5,0,0,0">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush>
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2" />
                                                    <TranslateTransform X="0.5" Y="0.5" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                            <GradientStop Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" CornerRadius="0,2.5,0,0">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush>
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2" />
                                                    <TranslateTransform X="-0.5" Y="0.5" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                            <GradientStop Color="#00000000" Offset="1" />
                                            <GradientStop Color="#FFFFFFFF" Offset="0" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1" Grid.Row="1" OpacityMask="#00000000" />
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="1">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="1,.5" StartPoint="0,.5">
                                            <GradientStop Color="#FF000000" Offset="1" />
                                            <GradientStop Color="#00FFFFFF" Offset="0" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Row="2" CornerRadius="0,0,0,2.5">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush>
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2" />
                                                    <TranslateTransform X="0.5" Y="-0.5" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="1" Grid.Row="2">
                                    <Border.OpacityMask>
                                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                            <GradientStop Color="#00000000" Offset="0" />
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                        </LinearGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                                <Border Background="{StaticResource SecondaryBrush}" Grid.Column="2" Grid.Row="2" CornerRadius="0,0,2.5,0">
                                    <Border.OpacityMask>
                                        <RadialGradientBrush>
                                            <RadialGradientBrush.RelativeTransform>
                                                <TransformGroup>
                                                    <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="2" ScaleY="2" />
                                                    <TranslateTransform X="-0.5" Y="-0.5" />
                                                </TransformGroup>
                                            </RadialGradientBrush.RelativeTransform>
                                            <GradientStop />
                                            <GradientStop Color="#FFFFFFFF" Offset="1" />
                                        </RadialGradientBrush>
                                    </Border.OpacityMask>
                                </Border>
                            </Grid>
                            <ScrollViewer x:Name="ScrollViewer" Background="{x:Null}" BorderBrush="Transparent" BorderThickness="0" IsTabStop="False" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
                                <ItemsPresenter Margin="5" x:Name="TreeItems" />
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- TreeviewItem -->
    <Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type TreeViewItem}">
        <Setter Property="Padding" Value="3" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="BorderBrush" Value="{StaticResource PrimaryBrush}" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid Background="{x:Null}" x:Name="Root">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="Header" Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="#FF999999" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Root" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0.75" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="15" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="1" Opacity="0" x:Name="grid">
                            <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness=".5,0.5,1,1">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1.75" StartPoint="0.5,-.5">
                                        <GradientStop Color="{StaticResource SecondaryColor}" Offset="0" />
                                        <GradientStop Color="{StaticResource PrimaryColor}" Offset=".01" />
                                        <GradientStop Color="{StaticResource PrimaryColor}" Offset=".3" />
                                        <GradientStop Color="{StaticResource SecondaryColor}" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                            </Border>
                            <Border x:Name="Halo" CornerRadius="12" Opacity=".65" Background="{StaticResource SecondaryBrush}" OpacityMask="{StaticResource HaloMask}" />
                        </Grid>
                        <ToggleButton IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" HorizontalAlignment="Stretch" x:Name="Expander" VerticalAlignment="Stretch" IsTabStop="False">
                            <ToggleButton.Template>
                                <ControlTemplate TargetType="ToggleButton">
                                    <Grid x:Name="Root" Background="Transparent">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Border" Storyboard.TargetProperty="(Shape.StrokeThickness)">
                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1.25" />
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To=".7" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CheckStates">
                                                <VisualState x:Name="Unchecked" />
                                                <VisualState x:Name="Checked">
                                                    <Storyboard>
                                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)">
                                                            <SplineDoubleKeyFrame KeyTime="0" Value="45" />
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Arrow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                                        </DoubleAnimationUsingKeyFrames>
                                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Border" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                            <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                                                        </DoubleAnimationUsingKeyFrames>
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid HorizontalAlignment="Right" Margin="2 2 5 2">
                                            <Grid x:Name="grid" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin=".25,.8" Height="10" Width="5">
                                                <Grid.RenderTransform>
                                                    <TransformGroup>
                                                        <RotateTransform />
                                                    </TransformGroup>
                                                </Grid.RenderTransform>
                                                <Path x:Name="Arrow" Stroke="{x:Null}" StrokeLineJoin="Miter" StrokeThickness=".75" Data="M 0,0 L 0,10 L 5,5 Z" Fill="{StaticResource TextBrush}" Opacity="0" />
                                                <Path x:Name="Border" Stroke="{StaticResource TextBrush}" StrokeLineJoin="Miter" StrokeThickness=".75" Data="M 0,0 L 0,10 L 5,5 Z" Fill="{x:Null}" />
                                            </Grid>
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>
                        <Button Cursor="{TemplateBinding Cursor}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" x:Name="Header" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" Foreground="{TemplateBinding Foreground}" IsTabStop="False" Grid.Column="1" ClickMode="Hover" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" Padding="8,3,8,3">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Grid Background="{TemplateBinding Background}">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="Pressed">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" To=".5" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" Storyboard.TargetName="content" Storyboard.TargetProperty="Opacity" To=".55" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid x:Name="hover" Opacity="0">
                                            <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness=".5,0.5,1,1">
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="0.5,1.75" StartPoint="0.5,-.5">
                                                        <GradientStop Color="{StaticResource SecondaryColor}" Offset="0" />
                                                        <GradientStop Color="{StaticResource PrimaryColor}" Offset=".01" />
                                                        <GradientStop Color="{StaticResource PrimaryColor}" Offset=".3" />
                                                        <GradientStop Color="{StaticResource SecondaryColor}" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <Border x:Name="Halo" CornerRadius="12" Opacity=".65" Background="{StaticResource SecondaryBrush}" OpacityMask="{StaticResource HaloMask}" />
                                        </Grid>
                                        <ContentPresenter Cursor="{TemplateBinding Cursor}" HorizontalAlignment="Left" Margin="{TemplateBinding Padding}" x:Name="content" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                                    </Grid>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                        <ItemsPresenter x:Name="ItemsHost" Visibility="Visible" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="false">
                            <Setter Property="Visibility" Value="Collapsed" TargetName="ItemsHost" />
                        </Trigger>
                        <Trigger Property="HasItems" Value="false">
                            <Setter Property="Visibility" Value="Hidden" TargetName="Expander" />
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.3" Storyboard.TargetName="MouseOverGrid" Storyboard.TargetProperty="Opacity" To="0.25" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.3" Storyboard.TargetName="MouseOverGrid" Storyboard.TargetProperty="Opacity" To="0" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="grid" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="0" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true" />
                                <Condition Property="IsSelectionActive" Value="false" />
                            </MultiTrigger.Conditions>
                            <MultiTrigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverGrid" Storyboard.TargetProperty="Opacity" To="0.5" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.EnterActions>
                            <MultiTrigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="00:00:00.3" Storyboard.TargetName="MouseOverGrid" Storyboard.TargetProperty="Opacity" To="0" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </MultiTrigger.ExitActions>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>